mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-22 08:41:32 +03:00
Try and catch to solve AccessDenied on nice stat on Windows 7
This commit is contained in:
parent
6a3f774943
commit
73c30932dd
@ -491,7 +491,10 @@ class GlancesGrabProcesses:
|
|||||||
|
|
||||||
if hasattr(proc, 'get_nice'):
|
if hasattr(proc, 'get_nice'):
|
||||||
# Deprecated in PsUtil 0.5.0+
|
# Deprecated in PsUtil 0.5.0+
|
||||||
|
try:
|
||||||
procstat['nice'] = proc.get_nice()
|
procstat['nice'] = proc.get_nice()
|
||||||
|
except psutil.AccessDenied, err:
|
||||||
|
pass
|
||||||
elif hasattr(proc, 'nice'):
|
elif hasattr(proc, 'nice'):
|
||||||
# Else
|
# Else
|
||||||
procstat['nice'] = proc.nice
|
procstat['nice'] = proc.nice
|
||||||
|
Loading…
Reference in New Issue
Block a user