From e200b6c47cd0daf6da1d4c781227553fa9d1c875 Mon Sep 17 00:00:00 2001 From: Dorin Date: Mon, 15 Jan 2024 19:16:13 +0200 Subject: [PATCH] Fix linting --- adafruit_wiznet5k/adafruit_wiznet5k_socket.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/adafruit_wiznet5k/adafruit_wiznet5k_socket.py b/adafruit_wiznet5k/adafruit_wiznet5k_socket.py index 6c26351..7fd3673 100644 --- a/adafruit_wiznet5k/adafruit_wiznet5k_socket.py +++ b/adafruit_wiznet5k/adafruit_wiznet5k_socket.py @@ -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.") @@ -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 @@ -762,3 +762,6 @@ class timeout(TimeoutError): def __init__(self, msg): super().__init__(msg) + + +# pylint: enable=unused-argument, redefined-builtin, invalid-name