Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Lib/multiprocessing/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,17 @@ def get_all_start_methods(self):
)
return start_method_names

def freeze_support(self):
'''Check whether this is a fake forked process in a frozen executable.
If so then run code specified by commandline and exit.
'''
start_method = self.get_start_method(allow_none=True)
if start_method is None:
start_method = self._default_context.get_start_method()
if start_method == 'spawn' and getattr(sys, 'frozen', False):
from .spawn import freeze_support
freeze_support()


#
# Context types for fixed start method
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:func:`multiprocessing.freeze_support` no longer sets the start method
globally.
Loading