From 7d9c43aa3766f46666659c6cfb04e1a58e081958 Mon Sep 17 00:00:00 2001 From: scosman Date: Mon, 12 Aug 2024 10:42:15 -0400 Subject: [PATCH] shutdown test --- desktop/desktop.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/desktop/desktop.py b/desktop/desktop.py index 6b711a0..a1534ce 100644 --- a/desktop/desktop.py +++ b/desktop/desktop.py @@ -68,16 +68,19 @@ def quit_app(): if root: root.destroy() - raise SystemExit(0) + sys.exit(0) def on_quit(): global root # use main runloop if possible - if root: - root.after(100, quit_app) - else: - raise SystemExit(0) + try: + if root: + root.after(100, quit_app) + else: + sys.exit(0) + finally: + sys.exit(0) def run_taskbar(): @@ -116,7 +119,7 @@ def close_splash(): if not uni_server.running(): # Can't start. Likely a port is already in use. Show the web app instead and exit show_studio() - exit(0) + sys.exit(0) # TK without a window, to get dock events on MacOS root = tk.Tk() root.title("fune") @@ -128,4 +131,4 @@ def close_splash(): root.after(10, close_splash) root.mainloop() tray.stop() - raise SystemExit(0) + sys.exit(0)