From 3a5cd8f3ff3e182cc6bab8279576408b652180a7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 3 Sep 2015 06:51:15 +0200 Subject: [PATCH] Revert "Remove test_ipc workaround again." This reverts commit f4d2e0746e8b59e4ae19f67f8c56dc0789d92d37. --- qutebrowser/misc/ipc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qutebrowser/misc/ipc.py b/qutebrowser/misc/ipc.py index a1b8bc47b..7e1ee36f8 100644 --- a/qutebrowser/misc/ipc.py +++ b/qutebrowser/misc/ipc.py @@ -140,6 +140,10 @@ class IPCServer(QObject): @pyqtSlot(int) def on_error(self, err): """Convenience method which calls _socket_error on an error.""" + if self._socket is None: + # Sometimes this gets called from stale sockets, especially in + # tests. + return self._timer.stop() log.ipc.debug("Socket error {}: {}".format( self._socket.error(), self._socket.errorString()))