8000 Revert "[3.14] gh-80334: fix multiprocessing.freeze_support for other… · python/cpython@0978de2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0978de2

Browse files
committed
Revert "[3.14] gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462) (#134619)"
This reverts commit 00fd544.
1 parent cbf4ccf commit 0978de2

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Doc/library/multiprocessing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ Miscellaneous
10811081
.. function:: freeze_support()
10821082

10831083
Add support for when a program which uses :mod:`multiprocessing` has been
1084-
frozen to produce an executable. (Has been tested with **py2exe**,
1084+
frozen to produce a Windows executable. (Has been tested with **py2exe**,
10851085
**PyInstaller** and **cx_Freeze**.)
10861086

10871087
One needs to call this function straight after the ``if __name__ ==
@@ -1099,10 +1099,10 @@ Miscellaneous
10991099
If the ``freeze_support()`` line is omitted then trying to run the frozen
11001100
executable will raise :exc:`RuntimeError`.
11011101

1102-
Calling ``freeze_support()`` has no effect when the start method is not
1103-
*spawn*. In addition, if the module is being run normally by the Python
1104-
interpreter (the program has not been frozen), then ``freeze_support()``
1105-
has no effect.
1102+
Calling ``freeze_support()`` has no effect when invoked on any operating
1103+
system other than Windows. In addition, if the module is being run
1104+
normally by the Python interpreter on Windows (the program has not been
1105+
frozen), then ``freeze_support()`` has no effect.
11061106

11071107
.. function:: get_all_start_methods()
11081108

Lib/multiprocessing/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def freeze_support(self):
145145
'''Check whether this is a fake forked process in a frozen executable.
146146
If so then run code specified by commandline and exit.
147147
'''
148-
if self.get_start_method() == 'spawn' and getattr(sys, 'frozen', False):
148+
if sys.platform == 'win32' and getattr(sys, 'frozen', False):
149149
from .spawn import freeze_support
150150
freeze_support()
151151

Misc/NEWS.d/next/Library/2025-05-24-03-10-36.gh-issue-80334.z21cMa.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0