issue4238: bsd support for cpu_count

This commit is contained in:
Jesse Noller 2008-11-28 18:59:35 +00:00
parent a280fd72e7
commit 1f8b49f517
1 changed files with 1 additions and 1 deletions

View File

@ -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: