summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-04-02 20:37:02 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2019-04-02 20:37:02 +0200
commitb23fb2910c851ae5497ff865a103af595e18e3f2 (patch)
treeb34dd1b984b3b1da4cd135cea835e435216f7a75
parentd9e69ccfc38702630d5f514daf7ba53fca543469 (diff)
downloadpsutil-b23fb2910c851ae5497ff865a103af595e18e3f2.tar.gz
#1404: fix regression not returning CPUs > 9
-rw-r--r--psutil/_pslinux.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
index fac9e781..ecba4139 100644
--- a/psutil/_pslinux.py
+++ b/psutil/_pslinux.py
@@ -629,7 +629,8 @@ def cpu_count_physical():
"""Return the number of physical cores in the system."""
# Method #1
core_ids = set()
- for path in glob.glob("/sys/devices/system/cpu/cpu[0-9]/topology/core_id"):
+ for path in glob.glob(
+ "/sys/devices/system/cpu/cpu[0-9]*/topology/core_id"):
with open_binary(path) as f:
core_ids.add(int(f.read()))
result = len(core_ids)