mirror of
https://github.com/qemu/qemu.git
synced 2025-08-14 11:43:46 +00:00
python/qemu/qmp.py: re-raise OSError when encountered
Nested if conditions don't change when the exception block fires; we need to explicitly re-raise the error if we didn't intend to capture and suppress it. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20201009175123.249009-3-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
c3a404d3be
commit
d5cca076c3
@ -169,9 +169,10 @@ def __get_events(self, wait: Union[bool, float] = False) -> None:
|
|||||||
try:
|
try:
|
||||||
self.__json_read()
|
self.__json_read()
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
if err.errno == errno.EAGAIN:
|
# EAGAIN: No data available; not critical
|
||||||
# No data available
|
if err.errno != errno.EAGAIN:
|
||||||
pass
|
raise
|
||||||
|
finally:
|
||||||
self.__sock.setblocking(True)
|
self.__sock.setblocking(True)
|
||||||
|
|
||||||
# Wait for new events, if needed.
|
# Wait for new events, if needed.
|
||||||
|
Loading…
Reference in New Issue
Block a user