mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #28779: multiprocessing.set_forkserver_preload() would crash the forkserver process if a preloaded module instantiated some multiprocessing objects such as locks.
This commit is contained in:
commit
ebb39bcc04
5 changed files with 37 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue