提交 0669dcb1 编写于 作者: N Nicolas Hennion

Another catch for NoSuchProcess - Correct issue #414

上级 bc660feb
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册