1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2024-10-26 07:55:06 +03:00

stream: Convert type() to isinstance()

Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
Philipp Hahn 2018-11-21 09:50:39 +01:00 committed by Daniel Berrange
parent d144e70957
commit 547965ecd9

View File

@ -49,7 +49,7 @@
try:
ret = handler(self, got, opaque)
if type(ret) is int and ret < 0:
if isinstance(ret, int) and ret < 0:
raise RuntimeError("recvAll handler returned %d" % ret)
except BaseException:
try:
@ -204,7 +204,7 @@
self.abort()
raise RuntimeError("recvHole handler failed")
ret_hole = holeHandler(self, length, opaque)
if type(ret_hole) is int and ret_hole < 0:
if isinstance(ret_hole, int) and ret_hole < 0:
self.abort()
raise RuntimeError("holeHandler handler returned %d" % ret_hole)
continue
@ -217,7 +217,7 @@
break
ret_data = handler(self, got, opaque)
if type(ret_data) is int and ret_data < 0:
if isinstance(ret_data, int) and ret_data < 0:
self.abort()
raise RuntimeError("sparseRecvAll handler returned %d" % ret_data)
@ -264,7 +264,7 @@
want = sectionLen
got = handler(self, want, opaque)
if type(got) is int and got < 0:
if isinstance(got, int) and got < 0:
self.abort()
raise RuntimeError("sparseSendAll handler returned %d" % got)