summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2011-03-16 09:43:06 -0400
committerRonald Oussoren <ronaldoussoren@mac.com>2011-03-16 09:43:06 -0400
commitf0edd1b86d1572c0fe9cc31b5aaadc12ea75f7f0 (patch)
treebdcc47127939551ca1075d03002d30c44ac35144
parent2e8a07c21d66235b79dc2e41b447d6492eee16bf (diff)
parent0b8753d24b9a37834c23faa1da705f4ed222d928 (diff)
downloadcpython-git-f0edd1b86d1572c0fe9cc31b5aaadc12ea75f7f0.tar.gz
Merge with 3.1
-rw-r--r--Lib/multiprocessing/__init__.py5
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS4
3 files changed, 9 insertions, 1 deletions
diff --git a/Lib/multiprocessing/__init__.py b/Lib/multiprocessing/__init__.py
index adad63063c..deb031c367 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
diff --git a/Misc/ACKS b/Misc/ACKS
index 89382672da..5c1bdc5904 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -624,6 +624,7 @@ Tim Northover
Joe Norton
Neal Norwitz
Michal Nowikowski
+Steffen Daode Nurpmeso
Nigel O'Brian
Kevin O'Connor
Tim O'Malley
diff --git a/Misc/NEWS b/Misc/NEWS
index 78442fac2f..bd21c5c71c 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -43,6 +43,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.