diff options
Diffstat (limited to 'psutil/_pslinux.py')
| -rw-r--r-- | psutil/_pslinux.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index e4bc7d75..8f3ff7d6 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -386,8 +386,9 @@ def virtual_memory(): mems = {} with open_binary('%s/meminfo' % get_procfs_path()) as f: for line in f: - fields = line.split() - mems[fields[0]] = int(fields[1]) * 1024 + name, _, value = line.partition(':') + value_num, _, units = value.partition(' ') + mems[name + ':'] = int(value_num) * 1024 # /proc doc states that the available fields in /proc/meminfo vary # by architecture and compile options, but these 3 values are also |
