diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-05-28 16:02:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-28 16:02:50 +0200 |
commit | 17a5588740b3d126d546ad1a13bdac4e028e6d50 (patch) | |
tree | 9e2045dcf3bf7772b03efabcb118e1d7c47beace /Lib | |
parent | a85a1d337d26a65036e427341d15e3979f7e9ced (diff) | |
download | cpython-git-17a5588740b3d126d546ad1a13bdac4e028e6d50.tar.gz |
bpo-33725: multiprocessing uses spawn by default on macOS (GH-13603)
On macOS, the multiprocessing module now uses the "spawn" start
method by default.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/multiprocessing/context.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/multiprocessing/context.py b/Lib/multiprocessing/context.py index 5a4865751c..5f8e0f0cd4 100644 --- a/Lib/multiprocessing/context.py +++ b/Lib/multiprocessing/context.py @@ -309,7 +309,12 @@ if sys.platform != 'win32': 'spawn': SpawnContext(), 'forkserver': ForkServerContext(), } - _default_context = DefaultContext(_concrete_contexts['fork']) + if sys.platform == 'darwin': + # bpo-33725: running arbitrary code after fork() is no longer reliable + # on macOS since macOS 10.14 (Mojave). Use spawn by default instead. + _default_context = DefaultContext(_concrete_contexts['spawn']) + else: + _default_context = DefaultContext(_concrete_contexts['fork']) else: |