Skip to content

Commit 5c55039

Browse files
author
ac133451
committed
fixed order of exception catch
1 parent 1b6d1bc commit 5c55039

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

DataSocket/TCPDataSocket.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,17 +428,17 @@ def _receive_data_raw(self):
428428
total_received += nbytes
429429
raise BlockingIOError
430430
except Exception as e:
431-
if isinstance(e, error):
432-
self.is_connected = False
433-
nbytes=0
434-
break
435-
elif isinstance(e, BlockingIOError):
431+
if isinstance(e, BlockingIOError):
436432
if nbytes > 0 and nbytes % self.max_tcp_packet_size != 0:
437433
raise e
438434
elif nbytes == 0:
439435
continue
440436
else:
441437
continue
438+
elif isinstance(e, error):
439+
self.is_connected = False
440+
nbytes=0
441+
break
442442
else:
443443
raise e
444444
if nbytes == 0:

0 commit comments

Comments
 (0)