enable bug-bear linting rules

This commit is contained in:
Jörg Thalheim
2024-09-02 13:26:07 +02:00
parent b313f2d066
commit 109d1faf9e
33 changed files with 214 additions and 104 deletions

View File

@@ -138,10 +138,10 @@ class QEMUMonitorProtocol:
self.__sock.settimeout(wait)
try:
ret = self.__json_read(only_event=True)
except TimeoutError:
raise QMPTimeoutError("Timeout waiting for event")
except Exception:
raise QMPConnectError("Error while reading from socket")
except TimeoutError as e:
raise QMPTimeoutError("Timeout waiting for event") from e
except OSError as e:
raise QMPConnectError("Error while reading from socket") from e
if ret is None:
raise QMPConnectError("Error while reading from socket")
self.__sock.settimeout(None)