summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2011-03-16 13:43:06 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2011-03-16 13:43:06 (GMT)
commitf0edd1b86d1572c0fe9cc31b5aaadc12ea75f7f0 (patch)
treebdcc47127939551ca1075d03002d30c44ac35144 /Lib
parent2e8a07c21d66235b79dc2e41b447d6492eee16bf (diff)
parent0b8753d24b9a37834c23faa1da705f4ed222d928 (diff)
downloadcpython-f0edd1b86d1572c0fe9cc31b5aaadc12ea75f7f0.zip
cpython-f0edd1b86d1572c0fe9cc31b5aaadc12ea75f7f0.tar.gz
cpython-f0edd1b86d1572c0fe9cc31b5aaadc12ea75f7f0.tar.bz2
Merge with 3.1
Diffstat (limited to 'Lib')
-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