Skip to content

Commit

Permalink
fix #1493: [Linux] cpu_freq(): handle the case where /sys/devices/sys…
Browse files Browse the repository at this point in the history
…tem/cpu/cpufreq/ exists but is empty.
  • Loading branch information
giampaolo committed Apr 26, 2019
1 parent 9314d26 commit c2b333b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
involved into oneshot() context.
- 1491_: [SunOS] net_if_addrs(): free() ifap struct on error. (patch by
Agnewee)
- 1493_: [Linux] cpu_freq(): handle the case where
/sys/devices/system/cpu/cpufreq/ exists but is empty.

5.6.1
=====
Expand Down
2 changes: 1 addition & 1 deletion psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def cpu_stats():
ctx_switches, interrupts, soft_interrupts, syscalls)


if os.path.exists("/sys/devices/system/cpu/cpufreq") or \
if os.path.exists("/sys/devices/system/cpu/cpufreq/policy0") or \
os.path.exists("/sys/devices/system/cpu/cpu0/cpufreq"):
def cpu_freq():
"""Return frequency metrics for all CPUs.
Expand Down

0 comments on commit c2b333b

Please sign in to comment.