commit 6926b8b2d4fdfa02ab67ad021cd6cce2764bb2fc parent 68cd37282eef863befdd369e5a3957e2c1852bee Author: SomberNight <somber.night@protonmail.com> Date: Mon, 4 Feb 2019 18:29:08 +0100 qt update checker: handle --offline Diffstat:
M | electrum/gui/qt/util.py | | | 13 | ++++++++++--- |
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/electrum/gui/qt/util.py b/electrum/gui/qt/util.py @@ -936,11 +936,18 @@ class UpdateCheckThread(QThread, PrintError): return StrictVersion(version_num.strip()) def run(self): + network = self.main_window.network + if not network: + self.failed.emit() + return try: - self.checked.emit(asyncio.run_coroutine_threadsafe(self.get_update_info(), self.main_window.network.asyncio_loop).result()) - except Exception: - self.print_error(traceback.format_exc()) + update_info = asyncio.run_coroutine_threadsafe(self.get_update_info(), network.asyncio_loop).result() + except Exception as e: + #self.print_error(traceback.format_exc()) + self.print_error(f"got exception: '{repr(e)}'") self.failed.emit() + else: + self.checked.emit(update_info) if __name__ == "__main__":