8000 GH-80334: make multiprocessing freeze_support() usable on all spawn default platforms, not just windows by gpshead · Pull Request #134617 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-80334: make multiprocessing freeze_support() usable on all spawn default platforms, not just windows #134617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Lib/multiprocessing/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ 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.
'''
if sys.platform == 'win32' and getattr(sys, 'frozen', False):
if self.get_start_method() == 'spawn' and getattr(sys, 'frozen', False):
from .spawn import freeze_support
freeze_support()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:func:`multiprocessing.freeze_support` now checks for work on any "spawn"
start method platform rather than only on Windows.
Loading
0