From 4fa5c031e320e26f8346fe9a41b69d4ee330fbd5 Mon Sep 17 00:00:00 2001 From: sanekb Date: Sun, 18 Jan 2026 08:54:00 +0300 Subject: [PATCH] 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 --- run.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 700e4308..f386a598 100644 --- a/run.py +++ b/run.py @@ -6,6 +6,10 @@ from pathlib import Path import swingmusic.__main__ as app 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. # add freeze support here as pyinstaller uses this entry @@ -20,5 +24,4 @@ if __name__ == "__main__": sys.argv.extend(["--client", client_str]) sys.orig_argv.extend(["--client", client_str]) - multiprocessing.freeze_support() app.run()