Merge pull request #118 from asergi/master

Fix bugs for psutil < 0.6.0
pull/119/head
Nicolas Hennion 2012-11-09 00:12:01 -08:00
commit 49587e1767
1 changed files with 4 additions and 3 deletions

View File

@ -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: