summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-04-25 05:18:05 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2019-04-25 05:18:05 +0200
commiteb6f1bc8d7c96d1951c85ad804104868c1d6a056 (patch)
tree6e4aa46b3f897faad98c39937abc9d3015dd8f78
parent398ae043991acf78f96299477232e763bf71b8ee (diff)
parent7ee88afd9f6730289cf9e34f70210fdb387b8a71 (diff)
downloadpsutil-eb6f1bc8d7c96d1951c85ad804104868c1d6a056.tar.gz
merge from master
-rw-r--r--CREDITS2
-rw-r--r--HISTORY.rst2
-rw-r--r--psutil/_pslinux.py2
-rwxr-xr-xpsutil/tests/test_linux.py8
4 files changed, 8 insertions, 6 deletions
diff --git a/CREDITS b/CREDITS
index 8d0ce8fb..20fe8962 100644
--- a/CREDITS
+++ b/CREDITS
@@ -62,7 +62,7 @@ I: 517, 607, 610, 1131, 1123, 1130, 1154, 1164, 1174, 1177, 1210, 1214, 1408,
N: Alex Manuskin
W: https://github.com/amanusk
D: FreeBSD cpu_freq(), OSX temperatures, support for Linux temperatures.
-I: 1284, 1345, 1350, 1352, 1472, 1481.
+I: 1284, 1345, 1350, 1352, 1472, 1481, 1487.
N: Jeff Tang
W: https://github.com/mrjefftang
diff --git a/HISTORY.rst b/HISTORY.rst
index edc0e0e6..9c3fa963 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -20,6 +20,8 @@
**Bug fixes**
- 1223_: [Windows] boot_time() may return value on Windows XP.
+- 1456_: [Linux] cpu_freq() returns None instead of 0.0 when min/max not
+ available (patch by Alex Manuskin)
- 1462_: [Linux] (tests) make tests invariant to LANG setting (patch by
- 1463_: cpu_distribution.py script was broken.
Benjamin Drung)
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
index eccfeed2..4c973c2d 100644
--- a/psutil/_pslinux.py
+++ b/psutil/_pslinux.py
@@ -712,7 +712,7 @@ elif os.path.exists("/proc/cpuinfo"):
for line in f:
if line.lower().startswith(b'cpu mhz'):
key, value = line.split(b'\t:', 1)
- ret.append(_common.scpufreq(float(value), None, None))
+ ret.append(_common.scpufreq(float(value), 0.0, 0.0))
return ret
diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py
index e8745a75..4cdc9cbf 100755
--- a/psutil/tests/test_linux.py
+++ b/psutil/tests/test_linux.py
@@ -739,11 +739,11 @@ class TestSystemCPUFrequency(unittest.TestCase):
ret = psutil.cpu_freq()
assert ret
assert flags
- self.assertIsNone(ret.min)
- self.assertIsNone(ret.max)
+ self.assertEqual(ret.max, 0.0)
+ self.assertEqual(ret.min, 0.0)
for freq in psutil.cpu_freq(percpu=True):
- self.assertIsNone(freq.min)
- self.assertIsNone(freq.max)
+ self.assertEqual(ret.max, 0.0)
+ self.assertEqual(ret.min, 0.0)
finally:
reload_module(psutil._pslinux)
reload_module(psutil)