Skip to content
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

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

Merged
merged 5 commits into from Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/black/__init__.py
Expand Up @@ -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()
Expand Down