提交 49587e17 编写于 作者: N Nicolas Hennion

Merge pull request #118 from asergi/master

Fix bugs for psutil < 0.6.0
......@@ -434,7 +434,7 @@ class glancesStats:
procstat['nice'] = proc.get_nice()
elif hasattr(proc, 'nice'):
# Else
procstat['nice'] = proc.nice()
procstat['nice'] = proc.nice
else:
# Never here...
procstat['nice'] = 0
......@@ -627,9 +627,10 @@ class glancesStats:
else:
# For olders PsUtil version
# Physical memory (RAM)
if hasattr(psutil, 'phymem_usage'):
if hasattr(psutil, 'phymem_usage'):
phymem = psutil.phymem_usage()
if hasattr(psutil, 'cached_usage') and hasattr(psutil, 'phymem_buffers'):
if (hasattr(psutil, 'cached_phymem') and
hasattr(psutil, 'phymem_buffers')):
# Cache stat only available for Linux
cachemem = psutil.cached_phymem() + psutil.phymem_buffers()
else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册