File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,8 +115,11 @@ def cpu_count():
115115 except (ValueError , KeyError ):
116116 num = 0
117117 elif 'bsd' in sys .platform or sys .platform == 'darwin' :
118+ comm = '/sbin/sysctl -n hw.ncpu'
119+ if sys .platform == 'darwin' :
120+ comm = '/usr' + comm
118121 try :
119- with os .popen ('sysctl -n hw.ncpu' ) as p :
122+ with os .popen (comm ) as p :
120123 num = int (p .read ())
121124 except ValueError :
122125 num = 0
Original file line number Diff line number Diff line change @@ -583,6 +583,7 @@ Tim Northover
583583Joe Norton
584584Neal Norwitz
585585Michal Nowikowski
586+ Steffen Daode Nurpmeso
586587Nigel O'Brian
587588Kevin O'Connor
588589Tim O'Malley
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ Core and Builtins
4040Library
4141-------
4242
43+ - Issue #11569: use absolute path to the sysctl command in multiprocessing to
44+ ensure that it will be found regardless of the shell PATH. This ensures
45+ that multiprocessing.cpu_count works on default installs of MacOSX.
46+
4347- Issue #11501: disutils.archive_utils.make_zipfile no longer fails if zlib is
4448 not installed. Instead, the zipfile.ZIP_STORED compression is used to create
4549 the ZipFile. Patch by Natalia B. Bidart.
You can’t perform that action at this time.
0 commit comments