Always call freeze_support() if sys.frozen is True (#3275)

This commit is contained in:
Richard Si 2022-09-25 20:55:52 -04:00 committed by GitHub
parent 2189bcaac0
commit af3de08154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -31,6 +31,9 @@
<!-- Changes to how Black is packaged, such as dependency requirements -->
- Executables made with PyInstaller will no longer crash when formatting several files
at once on macOS. Native x86-64 executables for macOS are available once again.
(#3275)
- Hatchling is now used as the build backend. This will not have any effect for users
who install Black with its wheels from PyPI. (#3233)
- Faster compiled wheels are now available for CPython 3.11 (#3276)

View File

@ -1375,7 +1375,9 @@ def patch_click() -> None:
def patched_main() -> None:
if sys.platform == "win32" and getattr(sys, "frozen", False):
# PyInstaller patches multiprocessing to need freeze_support() even in non-Windows
# environments so just assume we always need to call it if frozen.
if getattr(sys, "frozen", False):
from multiprocessing import freeze_support
freeze_support()