summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2016-12-10 16:16:17 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2016-12-10 16:16:17 (GMT)
commitebb39bcc048b33d529a64f517ccee1c172ff8b07 (patch)
treee9c5c42ccd7271e9d67506797417b06066d90f2a /Lib/multiprocessing
parent13f1c331a5dd5b4ff3b1e4c9e47d6d3ae75e0f8f (diff)
parentcd2a201e5bb33c9b44401a91e10189be87885efe (diff)
downloadcpython-ebb39bcc048b33d529a64f517ccee1c172ff8b07.zip
cpython-ebb39bcc048b33d529a64f517ccee1c172ff8b07.tar.gz
cpython-ebb39bcc048b33d529a64f517ccee1c172ff8b07.tar.bz2
Issue #28779: multiprocessing.set_forkserver_preload() would crash the forkserver process if a preloaded module instantiated some multiprocessing objects such as locks.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/context.py2
-rw-r--r--Lib/multiprocessing/spawn.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/multiprocessing/context.py b/Lib/multiprocessing/context.py
index 09455e2..623f6fb 100644
--- a/Lib/multiprocessing/context.py
+++ b/Lib/multiprocessing/context.py
@@ -196,7 +196,7 @@ class BaseContext(object):
def get_start_method(self, allow_none=False):
return self._name
- def set_start_method(self, method=None):
+ def set_start_method(self, method, force=False):
raise ValueError('cannot set start method of concrete context')
@property
diff --git a/Lib/multiprocessing/spawn.py b/Lib/multiprocessing/spawn.py
index dfb9f65..4aba372 100644
--- a/Lib/multiprocessing/spawn.py
+++ b/Lib/multiprocessing/spawn.py
@@ -217,7 +217,7 @@ def prepare(data):
process.ORIGINAL_DIR = data['orig_dir']
if 'start_method' in data:
- set_start_method(data['start_method'])
+ set_start_method(data['start_method'], force=True)
if 'init_main_from_name' in data:
_fixup_main_from_name(data['init_main_from_name'])