From f0fd0857ae16dd4cf712c496196ed63c337ba06b Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Fri, 8 Nov 2019 21:36:54 +0800 Subject: [PATCH] Fix bug when handling a broken tor connection --- onionshare_gui/tab/tab.py | 5 +---- tests2/gui_base_test.py | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/onionshare_gui/tab/tab.py b/onionshare_gui/tab/tab.py index 4bc45ac9..7c4926dd 100644 --- a/onionshare_gui/tab/tab.py +++ b/onionshare_gui/tab/tab.py @@ -380,10 +380,7 @@ class Tab(QtWidgets.QWidget): strings._("gui_tor_connection_lost"), strings._("gui_tor_connection_error_settings"), ) - - self.share_mode.handle_tor_broke() - self.receive_mode.handle_tor_broke() - self.website_mode.handle_tor_broke() + self.get_mode().handle_tor_broke() # Process events from the web object if self.mode == self.common.gui.MODE_SHARE: diff --git a/tests2/gui_base_test.py b/tests2/gui_base_test.py index d112fb28..3b27e928 100644 --- a/tests2/gui_base_test.py +++ b/tests2/gui_base_test.py @@ -46,7 +46,10 @@ class GuiBaseTest(unittest.TestCase): @classmethod def tearDownClass(cls): + # Quit + QtCore.QTimer.singleShot(0, cls.gui.close_dialog.accept_button.click) cls.gui.close() + cls.gui.cleanup() # Shared test methods