diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2019-04-26 11:07:40 +0800 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2019-04-26 11:07:40 +0800 |
commit | c78a850358af883dcaa63a3f9204f15cc129e518 (patch) | |
tree | 6a7a2d7690e0c03a2521625336597624d6273e58 | |
parent | d6f268f6059fde4283276b0501ad145d85106313 (diff) | |
download | psutil-c78a850358af883dcaa63a3f9204f15cc129e518.tar.gz |
remove catching IOError; let the test fail and adjust it later
-rw-r--r-- | psutil/_pslinux.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 02784602..33bafd28 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -708,17 +708,11 @@ elif os.path.exists("/proc/cpuinfo"): min and max frequencies are not available and are set to None. """ ret = [] - path = '%s/cpuinfo' % get_procfs_path() - if os.path.exists(path): - try: - with open_binary(path) as f: - for line in f: - if line.lower().startswith(b'cpu mhz'): - key, value = line.split(b'\t:', 1) - ret.append(_common.scpufreq(float(value), 0., 0.)) - except IOError as err: - raise NotImplementedError( - "%r for file %r" % (err, path)) + 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) + ret.append(_common.scpufreq(float(value), 0., 0.)) return ret else: |