summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2011-03-16 13:44:26 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2011-03-16 13:44:26 (GMT)
commit4d5fe33a7067310cca80351377c17712e4bd1360 (patch)
treecd48cd6b2e61b202ab73dcd68041d8495df30c07 /Lib/multiprocessing
parente371ad65f317c7bcf3355111ca08652254798f82 (diff)
parentf0edd1b86d1572c0fe9cc31b5aaadc12ea75f7f0 (diff)
downloadcpython-4d5fe33a7067310cca80351377c17712e4bd1360.zip
cpython-4d5fe33a7067310cca80351377c17712e4bd1360.tar.gz
cpython-4d5fe33a7067310cca80351377c17712e4bd1360.tar.bz2
Merge with 3.2
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/multiprocessing/__init__.py b/Lib/multiprocessing/__init__.py
index adad630..deb031c 100644
--- a/Lib/multiprocessing/__init__.py
+++ b/Lib/multiprocessing/__init__.py
@@ -115,8 +115,11 @@ def cpu_count():
except (ValueError, KeyError):
num = 0
elif 'bsd' in sys.platform or sys.platform == 'darwin':
+ comm = '/sbin/sysctl -n hw.ncpu'
+ if sys.platform == 'darwin':
+ comm = '/usr' + comm
try:
- with os.popen('sysctl -n hw.ncpu') as p:
+ with os.popen(comm) as p:
num = int(p.read())
except ValueError:
num = 0