From d6b87d74133dbe2f77b6a02305e19c59edb099e6 Mon Sep 17 00:00:00 2001 From: Florian Bach Date: Mon, 5 Sep 2022 19:01:57 +0200 Subject: [PATCH] Force-exit during plugin migration --- calibre-plugin/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/calibre-plugin/__init__.py b/calibre-plugin/__init__.py index 4eb4b3a..7272b9b 100644 --- a/calibre-plugin/__init__.py +++ b/calibre-plugin/__init__.py @@ -146,7 +146,12 @@ class ACSMInput(FileTypePlugin): plugins["ACSM Input"] = os.path.join(self.pluginsdir, "ACSM Input.zip") ui_plg_config['plugins'] = plugins - return + print("Need another restart due to plugin update ...") + # "Rude" exit, but otherwise it won't work ... + try: + os._exit(42) + except TypeError: + os._exit() # Make sure the GUI extension is loaded: