diff --git a/journalist_gui/journalist_gui/SecureDropUpdater.py b/journalist_gui/journalist_gui/SecureDropUpdater.py index 96f56a7708..3fbbedc57d 100644 --- a/journalist_gui/journalist_gui/SecureDropUpdater.py +++ b/journalist_gui/journalist_gui/SecureDropUpdater.py @@ -7,6 +7,7 @@ import pexpect import socket import sys +import syslog as log from journalist_gui import updaterUI, strings, resources_rc # noqa @@ -35,9 +36,7 @@ def prevent_second_instance(app: QtWidgets.QApplication, name: str) -> None: # app.instance_binding.bind(IDENTIFIER) except OSError as e: if e.errno == ALREADY_BOUND_ERRNO: - err_dialog = QtWidgets.QMessageBox() - err_dialog.setText(name + strings.app_is_already_running) - err_dialog.exec() + log.syslog(log.LOG_NOTICE, name + strings.app_is_already_running) sys.exit() else: raise diff --git a/journalist_gui/test_gui.py b/journalist_gui/test_gui.py index 10f99b1096..f5fed71bcf 100644 --- a/journalist_gui/test_gui.py +++ b/journalist_gui/test_gui.py @@ -13,7 +13,7 @@ @mock.patch('journalist_gui.SecureDropUpdater.sys.exit') -@mock.patch('journalist_gui.SecureDropUpdater.QtWidgets.QMessageBox') +@mock.patch('syslog.syslog') class TestSecondInstancePrevention(unittest.TestCase): def setUp(self): self.mock_app = mock.MagicMock()