mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-17 09:49:25 +03:00
stream: Do not use bare except
as it also catches SystemExit, InterruptedError, SyntaxError and such. Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
committed by
Daniel Berrange
parent
5777008197
commit
9074b50259
@ -51,11 +51,11 @@
|
|||||||
ret = handler(self, got, opaque)
|
ret = handler(self, got, opaque)
|
||||||
if type(ret) is int and ret < 0:
|
if type(ret) is int and ret < 0:
|
||||||
raise RuntimeError("recvAll handler returned %d" % ret)
|
raise RuntimeError("recvAll handler returned %d" % ret)
|
||||||
except Exception:
|
except BaseException:
|
||||||
e = sys.exc_info()[1]
|
e = sys.exc_info()[1]
|
||||||
try:
|
try:
|
||||||
self.abort()
|
self.abort()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
@ -76,11 +76,11 @@
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
got = handler(self, virStorageVol.streamBufSize, opaque)
|
got = handler(self, virStorageVol.streamBufSize, opaque)
|
||||||
except:
|
except BaseException:
|
||||||
e = sys.exc_info()[1]
|
e = sys.exc_info()[1]
|
||||||
try:
|
try:
|
||||||
self.abort()
|
self.abort()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user