Skip to content

Commit

Permalink
Merge branch 'master' of github.com:giampaolo/psutil
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Apr 25, 2019
2 parents eb6f1bc + 01e00a6 commit ff6dfe2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 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 Expand Up @@ -715,6 +715,12 @@ def cpu_freq():
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
Expand Down

0 comments on commit ff6dfe2

Please sign in to comment.