From 570350b0383d5d3085c3ff48ae15d797ffcb5b4b Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 6 May 2018 19:04:53 -0700 Subject: [PATCH] fix upgrade code --- AnkiConnect.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AnkiConnect.py b/AnkiConnect.py index 96076e7..29657ce 100644 --- a/AnkiConnect.py +++ b/AnkiConnect.py @@ -434,7 +434,7 @@ class AnkiConnect: if response == QMessageBox.Yes: try: - data = download(URL_UPGRADE) + data = self.download(URL_UPGRADE) path = os.path.splitext(__file__)[0] + '.py' with open(path, 'w') as fp: fp.write(makeStr(data)) @@ -444,8 +444,9 @@ class AnkiConnect: 'Upgraded to the latest version, please restart Anki.' ) return True - except: + except Exception as e: QMessageBox.critical(self.window(), 'AnkiConnect', 'Failed to download latest version.') + raise e return False