@@ -431,17 +431,20 @@ def accept(
431
431
if (
432
432
addr [0 ] == "0.0.0.0"
433
433
or addr [1 ] == 0
434
- or self ._interface .socket_status (self ._socknum ) != wiznet5k .adafruit_wiznet5k .SNSR_SOCK_ESTABLISHED
434
+ or self ._interface .socket_status (self ._socknum )
435
+ != wiznet5k .adafruit_wiznet5k .SNSR_SOCK_ESTABLISHED
435
436
):
436
437
if self ._timeout == 0 :
437
438
# non-blocking mode
438
439
raise OSError (errno .EAGAIN )
439
- elif self ._timeout and 0 < self ._timeout < ticks_diff (ticks_ms (), stamp ) / 1000 :
440
+ if (
441
+ self ._timeout
442
+ and 0 < self ._timeout < ticks_diff (ticks_ms (), stamp ) / 1000
443
+ ):
440
444
# blocking mode with timeout
441
445
raise OSError (errno .ETIMEDOUT )
442
- else :
443
- # blocking mode / timeout not expired
444
- continue
446
+ # blocking mode / timeout not expired
447
+ continue
445
448
current_socknum = self ._socknum
446
449
# Create a new socket object and swap socket nums, so we can continue listening
447
450
client_sock = Socket (self ._socket_pool )
@@ -586,7 +589,7 @@ def recvfrom( # pylint: disable=unused-argument
586
589
)
587
590
588
591
@_check_socket_closed
589
- def recv_into ( # pylint: disable=unused-argument
592
+ def recv_into ( # pylint: disable=unused-argument,too-many-branches
590
593
self , buffer : bytearray , nbytes : int = 0 , flags : int = 0
591
594
) -> int :
592
595
"""
@@ -651,8 +654,7 @@ def recv_into( # pylint: disable=unused-argument
651
654
# non-blocking mode
652
655
if num_read == 0 :
653
656
raise OSError (errno .EAGAIN )
654
- else :
655
- break
657
+ break
656
658
if ticks_diff (ticks_ms (), last_read_time ) / 1000 > self ._timeout :
657
659
raise OSError (errno .ETIMEDOUT )
658
660
return num_read
0 commit comments