diff options
author | asergi <al3hex@gmail.com> | 2012-11-09 00:20:00 +0100 |
---|---|---|
committer | asergi <al3hex@gmail.com> | 2012-11-09 00:20:00 +0100 |
commit | aa5d77b299d0515b33fdb125451e7361dc9c109c (patch) | |
tree | 6e119bb1819a6853c2db96a4a949e7e7968f1c68 | |
parent | b9c6615e213f3df35110ab2242b52fa3df4fe78c (diff) |
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: |