diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2019-06-12 13:03:16 +0800 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2019-06-12 13:03:16 +0800 |
commit | 6705c189236dbd57e27a7eed0a096dcbc27d2054 (patch) | |
tree | 8d210985ee97e7ff4636b4f776e6ae3829495928 | |
parent | f650146a5c92baac01077a767a87780f1c8742aa (diff) | |
parent | 4b2acfe192e3baf3a10701e132769650e3070f64 (diff) | |
download | psutil-6705c189236dbd57e27a7eed0a096dcbc27d2054.tar.gz |
Merge branch 'master' of github.com:giampaolo/psutil
-rw-r--r-- | psutil/_pslinux.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 8f3ff7d6..e4bc7d75 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -386,9 +386,8 @@ def virtual_memory(): mems = {} with open_binary('%s/meminfo' % get_procfs_path()) as f: for line in f: - name, _, value = line.partition(':') - value_num, _, units = value.partition(' ') - mems[name + ':'] = int(value_num) * 1024 + fields = line.split() + mems[fields[0]] = int(fields[1]) * 1024 # /proc doc states that the available fields in /proc/meminfo vary # by architecture and compile options, but these 3 values are also |