Kaydet (Commit) 1f8b49f5 authored tarafından Jesse Noller's avatar Jesse Noller

issue4238: bsd support for cpu_count

üst a280fd72
...@@ -113,7 +113,7 @@ def cpu_count(): ...@@ -113,7 +113,7 @@ def cpu_count():
num = int(os.environ['NUMBER_OF_PROCESSORS']) num = int(os.environ['NUMBER_OF_PROCESSORS'])
except (ValueError, KeyError): except (ValueError, KeyError):
num = 0 num = 0
elif sys.platform == 'darwin': elif 'bsd' in sys.platform or sys.platform == 'darwin':
try: try:
num = int(os.popen('sysctl -n hw.ncpu').read()) num = int(os.popen('sysctl -n hw.ncpu').read())
except ValueError: except ValueError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment