fix: handle Ctrl+C in restart_server without traceback
CI / test (push) Successful in 28s

This commit is contained in:
strsv committed 2026-11-09 08:29:45 +03:00
1 parent be4fbf6864
commit 1b7830aa9b
9 files changed
+76 -19

No files matched your search

+9 -2
View File
@@ -118,8 +118,15 @@ def main():
cmd = [sys.executable, SERVER, "--port", str(final_port)]
if not no_open:
cmd.append("--open")
return subprocess.call(cmd, cwd=APP_DIR)
try:
code = subprocess.call(cmd, cwd=APP_DIR)
except KeyboardInterrupt:
return 0
return 0 if code in (0, -1073741510) else code # Ctrl+C on Windows
if __name__ == "__main__":
raise SystemExit(main())
try:
raise SystemExit(main())
except KeyboardInterrupt:
raise SystemExit(0)