diffrent way of shutdown catch

This commit is contained in:
2025-12-06 23:20:05 +01:00
parent 89bbb53c51
commit a931e5aad3
+4 -1
View File
@@ -305,7 +305,10 @@ def main():
log_file_path.touch() log_file_path.touch()
core = RadioPlayer((" ".join(sys.argv[1:]) if len(sys.argv) > 1 else None), open(log_file_path, "w")) core = RadioPlayer((" ".join(sys.argv[1:]) if len(sys.argv) > 1 else None), open(log_file_path, "w"))
atexit.register(core.shutdown) try:
core.start() core.start()
signal.signal(signal.SIGINT, core.handle_sigint) signal.signal(signal.SIGINT, core.handle_sigint)
core.loop() core.loop()
except SystemExit:
core.shutdown()
raise