summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-04-25 14:40:20 +0800
committerGitHub <noreply@github.com>2019-04-25 14:40:20 +0800
commit84d180962797329e0ac373ddd9e185985c302677 (patch)
tree86a14ec27de8f09b2f222e5a1898d37fe8dccdbf
parent01e00a6629a78a7277aac627c8b025cb753d6fee (diff)
downloadpsutil-revert-1493-fix_cpu_freq.tar.gz
Revert "Fix cpu_freq (#1493)"revert-1493-fix_cpu_freq
This reverts commit 01e00a6629a78a7277aac627c8b025cb753d6fee.
-rw-r--r--psutil/_pslinux.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
index ac45b54b..4c973c2d 100644
--- a/psutil/_pslinux.py
+++ b/psutil/_pslinux.py
@@ -668,7 +668,7 @@ def cpu_stats():
ctx_switches, interrupts, soft_interrupts, syscalls)
-if os.path.exists("/sys/devices/system/cpu/cpufreq/policy0") or \
+if os.path.exists("/sys/devices/system/cpu/cpufreq") or \
os.path.exists("/sys/devices/system/cpu/cpu0/cpufreq"):
def cpu_freq():
"""Return frequency metrics for all CPUs.
@@ -715,12 +715,6 @@ elif os.path.exists("/proc/cpuinfo"):
ret.append(_common.scpufreq(float(value), 0.0, 0.0))
return ret
-else:
- def cpu_freq():
- """Dummy implementation when none of the above files are present.
- """
- return []
-
# =====================================================================
# --- network