From b77a43e48812078893ea8fbb979a4c3f63b26675 Mon Sep 17 00:00:00 2001 From: Justin Myers Date: Mon, 20 May 2024 15:54:33 -0700 Subject: [PATCH 1/2] Remove SocketPoolContants --- adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py b/adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py index 0509a63..4495685 100644 --- a/adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py +++ b/adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py @@ -37,8 +37,8 @@ _global_socketpool = {} -class SocketPoolContants: # pylint: disable=too-few-public-methods - """Helper class for the constants that are needed everywhere""" +class SocketPool: + """WIZNET5K SocketPool library""" # These must match circuitpython "socketpoool" values. However, we cannot # depend on socketpool being importable, so hard-code them here. @@ -50,10 +50,6 @@ class SocketPoolContants: # pylint: disable=too-few-public-methods AF_INET = const(3) - -class SocketPool(SocketPoolContants): - """WIZNET5K SocketPool library""" - def __new__(cls, iface: WIZNET5K): # We want to make sure to return the same pool for the same interface if iface not in _global_socketpool: @@ -191,7 +187,7 @@ def getaddrinfo( # pylint: disable=redefined-builtin,too-many-arguments,unused- raise ValueError("Port must be an integer") if not self._is_ipv4_string(host): host = self.gethostbyname(host) - return [(SocketPoolContants.AF_INET, type, proto, "", (host, port))] + return [(SocketPool.AF_INET, type, proto, "", (host, port))] def gethostbyname(self, hostname: str) -> str: """ @@ -210,8 +206,8 @@ def gethostbyname(self, hostname: str) -> str: def socket( # pylint: disable=redefined-builtin self, - family: int = SocketPoolContants.AF_INET, - type: int = SocketPoolContants.SOCK_STREAM, + family: int = AF_INET, + type: int = SOCK_STREAM, proto: int = 0, fileno: Optional[int] = None, ): From ebf4677933d3c63c110fd045b5c40a2c5bf6a228 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 20 May 2024 19:24:14 -0400 Subject: [PATCH 2/2] Update adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py --- adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py b/adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py index 4495685..6ec03ed 100644 --- a/adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py +++ b/adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py @@ -40,7 +40,7 @@ class SocketPool: """WIZNET5K SocketPool library""" - # These must match circuitpython "socketpoool" values. However, we cannot + # These must match circuitpython "socketpool" values. However, we cannot # depend on socketpool being importable, so hard-code them here. SOCK_STREAM = 1 SOCK_DGRAM = 2