mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
issue4238: bsd support for cpu_count
This commit is contained in:
parent
a280fd72e7
commit
1f8b49f517
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue