Skip to content

Commit

Permalink
Handle sysctl not containing core counts
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Feb 20, 2017
1 parent 408cc5f commit 6f22e7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions px/px_cpuinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@ def get_core_count_from_sysctl():
elif line.startswith(LOGICAL_PREFIX):
logical = int(line[len(LOGICAL_PREFIX)])

if physical is None or logical is None:
# On Linux, sysctl exists but it doesn't contain the values we want
return None

return (physical, logical)

0 comments on commit 6f22e7c

Please sign in to comment.