mirror of
https://github.com/python/cpython.git
synced 2025-11-10 10:32:04 +00:00
[3.14] gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462) (#134619)
gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462)
Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform
Have multiprocessing.freeze_support() enable on spawn, not just win32.
---------
(cherry picked from commit 80284b5c5e)
Co-authored-by: Eddy Mulyono <eddymul@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
parent
de9444ef94
commit
00fd5440f0
3 changed files with 8 additions and 6 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue