Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
us3r64 committed Jan 15, 2024
1 parent 22bf906 commit e200b6c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions adafruit_wiznet5k/adafruit_wiznet5k_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ def getdefaulttimeout() -> Optional[float]:
return _default_socket_timeout


def setdefaulttimeout(timeout: Optional[float]) -> None:
def setdefaulttimeout(_timeout: Optional[float]) -> None:
"""
Set the default timeout in seconds (float) for new socket objects. When the socket
module is first imported, the default is None. See settimeout() for possible values
and their respective meanings.
:param Optional[float] timeout: The default timeout in seconds or None.
:param Optional[float] _timeout: The default timeout in seconds or None.
"""
global _default_socket_timeout # pylint: disable=global-statement
if timeout is None or (isinstance(timeout, (int, float)) and timeout >= 0):
if _timeout is None or (isinstance(timeout, (int, float)) and timeout >= 0):
_default_socket_timeout = timeout
else:
raise ValueError("Timeout must be None, 0.0 or a positive numeric value.")
Expand Down Expand Up @@ -450,8 +450,8 @@ def send(self, data: Union[bytes, bytearray]) -> int:
:return int: Number of bytes sent.
"""
timeout = 0 if self._timeout is None else self._timeout
bytes_sent = _the_interface.socket_write(self._socknum, data, timeout)
_timeout = 0 if self._timeout is None else self._timeout
bytes_sent = _the_interface.socket_write(self._socknum, data, _timeout)
gc.collect()
return bytes_sent

Expand Down Expand Up @@ -762,3 +762,6 @@ class timeout(TimeoutError):

def __init__(self, msg):
super().__init__(msg)


# pylint: enable=unused-argument, redefined-builtin, invalid-name

0 comments on commit e200b6c

Please sign in to comment.