Revert "Remove test_ipc workaround again."

This reverts commit f4d2e0746e.
This commit is contained in:
Florian Bruhin 2015-09-03 06:51:15 +02:00
parent 46b28387db
commit 3a5cd8f3ff

View File

@ -140,6 +140,10 @@ class IPCServer(QObject):
@pyqtSlot(int) @pyqtSlot(int)
def on_error(self, err): def on_error(self, err):
"""Convenience method which calls _socket_error on an error.""" """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() self._timer.stop()
log.ipc.debug("Socket error {}: {}".format( log.ipc.debug("Socket error {}: {}".format(
self._socket.error(), self._socket.errorString())) self._socket.error(), self._socket.errorString()))