diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2019-06-12 12:43:17 +0800 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2019-06-12 12:43:17 +0800 |
commit | f650146a5c92baac01077a767a87780f1c8742aa (patch) | |
tree | 11ee64560816feae438cbebf4b02761cf6f12310 | |
parent | 48cb36cdff2c83be6c3d265f8a10040ec74d10a0 (diff) | |
parent | 6b994c625db2abaaadf58a0425f9daaf3e4ad9e5 (diff) | |
download | psutil-f650146a5c92baac01077a767a87780f1c8742aa.tar.gz |
Merge branch 'master' of github.com:giampaolo/psutil
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | psutil/_pslinux.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml index fdab64f6..b3b0102d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ -sudo: false language: python cache: pip matrix: @@ -10,7 +9,6 @@ matrix: - python: 3.6 - python: 3.7 dist: xenial - sudo: true # macOS - language: generic os: osx 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 |