diff options
author | Nicolas Hennion <nicolashennion@gmail.com> | 2012-11-09 00:12:01 -0800 |
---|---|---|
committer | Nicolas Hennion <nicolashennion@gmail.com> | 2012-11-09 00:12:01 -0800 |
commit | 49587e1767bfaac3a28bdf5592c76ebd5b92df88 (patch) | |
tree | 6e119bb1819a6853c2db96a4a949e7e7968f1c68 | |
parent | b9c6615e213f3df35110ab2242b52fa3df4fe78c (diff) | |
parent | aa5d77b299d0515b33fdb125451e7361dc9c109c (diff) |
Merge pull request #118 from asergi/master
Fix bugs for psutil < 0.6.0
-rwxr-xr-x | glances/glances.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/glances/glances.py b/glances/glances.py index 112cf7bd..e73a3d0a 100755 --- a/glances/glances.py +++ b/glances/glances.py @@ -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: |