@@ -49,7 +49,7 @@ def handler(stream, # virStream instance
49
49
50
50
try :
51
51
ret = handler (self , got , opaque )
52
- if type (ret ) is int and ret < 0 :
52
+ if isinstance (ret , int ) and ret < 0 :
53
53
raise RuntimeError ("recvAll handler returned %d" % ret )
54
54
except BaseException :
55
55
try :
@@ -204,7 +204,7 @@ def holeHandler(stream, # virStream instance
204
204
self .abort ()
205
205
raise RuntimeError ("recvHole handler failed" )
206
206
ret_hole = holeHandler (self , length , opaque )
207
- if type (ret_hole ) is int and ret_hole < 0 :
207
+ if isinstance (ret_hole , int ) and ret_hole < 0 :
208
208
self .abort ()
209
209
raise RuntimeError ("holeHandler handler returned %d" % ret_hole )
210
210
continue
@@ -217,7 +217,7 @@ def holeHandler(stream, # virStream instance
217
217
break
218
218
219
219
ret_data = handler (self , got , opaque )
220
- if type (ret_data ) is int and ret_data < 0 :
220
+ if isinstance (ret_data , int ) and ret_data < 0 :
221
221
self .abort ()
222
222
raise RuntimeError ("sparseRecvAll handler returned %d" % ret_data )
223
223
@@ -264,7 +264,7 @@ def skipHandler(stream, # virStream instance
264
264
want = sectionLen
265
265
266
266
got = handler (self , want , opaque )
267
- if type (got ) is int and got < 0 :
267
+ if isinstance (got , int ) and got < 0 :
268
268
self .abort ()
269
269
raise RuntimeError ("sparseSendAll handler returned %d" % got )
270
270
0 commit comments