mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-04 12:21:57 +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)
|
||||
if type(ret) is int and ret < 0:
|
||||
raise RuntimeError("recvAll handler returned %d" % ret)
|
||||
except Exception:
|
||||
except BaseException:
|
||||
e = sys.exc_info()[1]
|
||||
try:
|
||||
self.abort()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
raise e
|
||||
|
||||
@ -76,11 +76,11 @@
|
||||
while True:
|
||||
try:
|
||||
got = handler(self, virStorageVol.streamBufSize, opaque)
|
||||
except:
|
||||
except BaseException:
|
||||
e = sys.exc_info()[1]
|
||||
try:
|
||||
self.abort()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
raise e
|
||||
|
||||
|
Reference in New Issue
Block a user