mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-07-30 07:49:18 +02:00
diffrent way of shutdown catch
This commit is contained in:
+7
-4
@@ -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
|
||||||
Reference in New Issue
Block a user