diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-03-29 21:11:26 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-03-29 23:45:41 +0200 |
commit | 3ce4d5916c932b369634c90c6a9d98925c688216 (patch) | |
tree | d7a9cc1094bc59577de09221fe7dd8db73657cee | |
parent | 5c14bfd8c6670519e06d01115624de8c6afd49a5 (diff) | |
download | qutebrowser-3ce4d5916c932b369634c90c6a9d98925c688216.tar.gz qutebrowser-3ce4d5916c932b369634c90c6a9d98925c688216.zip |
ipc: Hide socket warning when re-getting socket
(cherry picked from commit 6de2d238418ddd8d0791584635955d9882618060)
-rw-r--r-- | qutebrowser/misc/ipc.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/qutebrowser/misc/ipc.py b/qutebrowser/misc/ipc.py index 86f0422f3..77b9e8f6c 100644 --- a/qutebrowser/misc/ipc.py +++ b/qutebrowser/misc/ipc.py @@ -356,13 +356,18 @@ class IPCServer(QObject): self.got_args.emit(args, target_arg, cwd) - def _get_socket(self): - """Get the current socket for on_ready_read.""" + def _get_socket(self, warn=True): + """Get the current socket for on_ready_read. + + Arguments: + warn: Whether to warn if no socket was found. + """ if self._socket is None: # pragma: no cover # This happens when doing a connection while another one is already # active for some reason. if self._old_socket is None: - log.ipc.warning("In _get_socket with None socket and old_socket!") + if warn: + log.ipc.warning("In _get_socket with None socket and old_socket!") return None log.ipc.debug("In _get_socket with None socket!") socket = self._old_socket @@ -387,7 +392,7 @@ class IPCServer(QObject): log.ipc.debug("Read from socket 0x{:x}: {!r}".format( id(socket), data)) self._handle_data(data) - socket = self._get_socket() + socket = self._get_socket(warn=False) if self._socket is not None: self._timer.start() |