diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2011-03-16 13:44:26 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2011-03-16 13:44:26 (GMT) |
commit | 4d5fe33a7067310cca80351377c17712e4bd1360 (patch) | |
tree | cd48cd6b2e61b202ab73dcd68041d8495df30c07 /Lib/multiprocessing | |
parent | e371ad65f317c7bcf3355111ca08652254798f82 (diff) | |
parent | f0edd1b86d1572c0fe9cc31b5aaadc12ea75f7f0 (diff) | |
download | cpython-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__.py | 5 |
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 |