fix #440: move freeze_support to top of run.py to fix Windows crash (#450)

fix: call freeze_support immediately to fix Windows EXE crash
This commit is contained in:
sanekb
2026-01-18 08:54:00 +03:00
committed by GitHub
parent 0664bb1790
commit 4fa5c031e3
+4 -1
View File
@@ -6,6 +6,10 @@ from pathlib import Path
import swingmusic.__main__ as app import swingmusic.__main__ as app
if __name__ == "__main__": if __name__ == "__main__":
# Fixed: freeze_support() must be called immediately to prevent
# recursive process spawning and ArgumentParser errors on Windows EXE.
multiprocessing.freeze_support()
# this entry should only be used by pyinstaller. # this entry should only be used by pyinstaller.
# add freeze support here as pyinstaller uses this entry # add freeze support here as pyinstaller uses this entry
@@ -20,5 +24,4 @@ if __name__ == "__main__":
sys.argv.extend(["--client", client_str]) sys.argv.extend(["--client", client_str])
sys.orig_argv.extend(["--client", client_str]) sys.orig_argv.extend(["--client", client_str])
multiprocessing.freeze_support()
app.run() app.run()