Skip to content

Commit

Permalink
Pass tests on Python 2.7 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Feb 19, 2017
1 parent 4929b38 commit f8fe6f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions px/px_cpuinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_core_count_from_proc_cpuinfo(proc_cpuinfo="/proc/cpuinfo"):
max_core_id = max(core_id, max_core_id)

return (max_core_id + 1, max_processor_no + 1)
except OSError as e:
except (IOError, OSError) as e:
if e.errno == errno.ENOENT:
# /proc/cpuinfo not found, we're probably not on Linux
return None
Expand All @@ -57,7 +57,7 @@ def get_core_count_from_sysctl():
sysctl = subprocess.Popen(["sysctl", 'hw'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
env=env)
except OSError as e:
except (IOError, OSError) as e:
if e.errno == errno.ENOENT:
# sysctl not found, we're probably not on OSX
return None
Expand Down

0 comments on commit f8fe6f2

Please sign in to comment.