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 | |
parent | e371ad65f317c7bcf3355111ca08652254798f82 (diff) | |
parent | f0edd1b86d1572c0fe9cc31b5aaadc12ea75f7f0 (diff) | |
download | cpython-4d5fe33a7067310cca80351377c17712e4bd1360.zip cpython-4d5fe33a7067310cca80351377c17712e4bd1360.tar.gz cpython-4d5fe33a7067310cca80351377c17712e4bd1360.tar.bz2 |
Merge with 3.2
-rw-r--r-- | Lib/multiprocessing/__init__.py | 5 | ||||
-rw-r--r-- | Misc/NEWS | 4 |
2 files changed, 8 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 @@ -75,6 +75,10 @@ Library - Issue #11133: fix two cases where inspect.getattr_static can trigger code execution. Patch by Daniel Urban. +- Issue #11569: use absolute path to the sysctl command in multiprocessing to + ensure that it will be found regardless of the shell PATH. This ensures + that multiprocessing.cpu_count works on default installs of MacOSX. + - Issue #11501: disutils.archive_utils.make_zipfile no longer fails if zlib is not installed. Instead, the zipfile.ZIP_STORED compression is used to create the ZipFile. Patch by Natalia B. Bidart. |