Skip to content

Commit

Permalink
CTX-5485: Added comments explaining why freeze.support() for multipro…
Browse files Browse the repository at this point in the history
…cessing and detecting frozen state is needed.
  • Loading branch information
Bogdan Tintor committed Aug 19, 2024
1 parent e6986d5 commit dd85839
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ def cli() -> None:


if __name__ == "__main__":
# Ensures compatibility with the multiprocessing module when running as a compiled executable.
# PyInstaller creates a 'frozen' executable, which might not handle multiprocessing properly without this.
multiprocessing.freeze_support()

# If the script is running as a PyInstaller compiled executable ('frozen' state),
# invoke the command-line interface (CLI) with the provided arguments.
if getattr(sys, 'frozen', False):
cli(sys.argv[1:])

0 comments on commit dd85839

Please sign in to comment.