diff options
author | Michał Górny <mgorny@gentoo.org> | 2020-04-14 14:14:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-14 14:14:55 +0200 |
commit | f884ef43fd4547080735565b5cd7f46faa5e2191 (patch) | |
tree | 590894d8a1286d6e9584107ac2bd327b01a97b07 | |
parent | 4d6a086411c77b7909cce8f4f141bbdecfc0d354 (diff) | |
download | psutil-f884ef43fd4547080735565b5cd7f46faa5e2191.tar.gz |
Fix handling /proc/cpuinfo without tabs (#1726)
/proc/cpuinfo uses spaces rather than tabs on ia64. Since there seems
not to be any reason to require specific kind of whitespace before ':'
on 'cpu mhz' line, just split on ':'.
See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/ia64/kernel/setup.c#n700
-rw-r--r-- | psutil/_pslinux.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 9e32f25e..4fb783d1 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -716,7 +716,7 @@ elif os.path.exists("/proc/cpuinfo"): with open_binary('%s/cpuinfo' % get_procfs_path()) as f: for line in f: if line.lower().startswith(b'cpu mhz'): - key, value = line.split(b'\t:', 1) + key, value = line.split(b':', 1) ret.append(_common.scpufreq(float(value), 0., 0.)) return ret |