mirror of https://github.com/python/cpython
issue4238: bsd support for cpu_count
This commit is contained in:
parent
a280fd72e7
commit
1f8b49f517
|
@ -113,7 +113,7 @@ def cpu_count():
|
|||
num = int(os.environ['NUMBER_OF_PROCESSORS'])
|
||||
except (ValueError, KeyError):
|
||||
num = 0
|
||||
elif sys.platform == 'darwin':
|
||||
elif 'bsd' in sys.platform or sys.platform == 'darwin':
|
||||
try:
|
||||
num = int(os.popen('sysctl -n hw.ncpu').read())
|
||||
except ValueError:
|
||||
|
|
Loading…
Reference in New Issue