mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-28 11:41:46 +03:00
Another catch for NoSuchProcess - Correct issue #414
This commit is contained in:
parent
bc660feb2e
commit
0669dcb189
@ -149,8 +149,12 @@ class GlancesProcesses(object):
|
||||
procstat['mandatory_stats'] = True
|
||||
|
||||
# Process CPU, MEM percent and name
|
||||
procstat.update(
|
||||
proc.as_dict(attrs=['cpu_percent', 'memory_percent', 'name'], ad_value=''))
|
||||
try:
|
||||
procstat.update(
|
||||
proc.as_dict(attrs=['cpu_percent', 'memory_percent', 'name'], ad_value=''))
|
||||
except psutil.NoSuchProcess:
|
||||
# Correct issue #414
|
||||
return None
|
||||
if procstat['cpu_percent'] == '' or procstat['memory_percent'] == '':
|
||||
# Do not display process if we can not get the basic
|
||||
# cpu_percent or memory_percent stats
|
||||
|
Loading…
Reference in New Issue
Block a user