Skip to content

Commit b6b6666

Browse files
authored
Fix style issues flagged by Black and Pylint
1 parent afedb19 commit b6b6666

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,17 +431,20 @@ def accept(
431431
if (
432432
addr[0] == "0.0.0.0"
433433
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
435436
):
436437
if self._timeout == 0:
437438
# non-blocking mode
438439
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+
):
440444
# blocking mode with timeout
441445
raise OSError(errno.ETIMEDOUT)
442-
else:
443-
# blocking mode / timeout not expired
444-
continue
446+
# blocking mode / timeout not expired
447+
continue
445448
current_socknum = self._socknum
446449
# Create a new socket object and swap socket nums, so we can continue listening
447450
client_sock = Socket(self._socket_pool)
@@ -586,7 +589,7 @@ def recvfrom( # pylint: disable=unused-argument
586589
)
587590

588591
@_check_socket_closed
589-
def recv_into( # pylint: disable=unused-argument
592+
def recv_into( # pylint: disable=unused-argument,too-many-branches
590593
self, buffer: bytearray, nbytes: int = 0, flags: int = 0
591594
) -> int:
592595
"""
@@ -651,8 +654,7 @@ def recv_into( # pylint: disable=unused-argument
651654
# non-blocking mode
652655
if num_read == 0:
653656
raise OSError(errno.EAGAIN)
654-
else:
655-
break
657+
break
656658
if ticks_diff(ticks_ms(), last_read_time) / 1000 > self._timeout:
657659
raise OSError(errno.ETIMEDOUT)
658660
return num_read

0 commit comments

Comments
 (0)