Skip to content

Commit 3575a0e

Browse files
committed
Remove SocketPoolContants
1 parent 69fac99 commit 3575a0e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

adafruit_esp32spi/adafruit_esp32spi_socketpool.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
_global_socketpool = {}
3030

3131

32-
class SocketPoolContants: # pylint: disable=too-few-public-methods
33-
"""Helper class for the constants that are needed everywhere"""
32+
class SocketPool:
33+
"""ESP32SPI SocketPool library"""
3434

3535
SOCK_STREAM = const(0)
3636
SOCK_DGRAM = const(1)
@@ -39,10 +39,6 @@ class SocketPoolContants: # pylint: disable=too-few-public-methods
3939

4040
MAX_PACKET = const(4000)
4141

42-
43-
class SocketPool(SocketPoolContants):
44-
"""ESP32SPI SocketPool library"""
45-
4642
def __new__(cls, iface: ESP_SPIcontrol):
4743
# We want to make sure to return the same pool for the same interface
4844
if iface not in _global_socketpool:
@@ -60,12 +56,12 @@ def getaddrinfo( # pylint: disable=too-many-arguments,unused-argument
6056
if not isinstance(port, int):
6157
raise ValueError("Port must be an integer")
6258
ipaddr = self._interface.get_host_by_name(host)
63-
return [(SocketPoolContants.AF_INET, socktype, proto, "", (ipaddr, port))]
59+
return [(SocketPool.AF_INET, socktype, proto, "", (ipaddr, port))]
6460

6561
def socket( # pylint: disable=redefined-builtin
6662
self,
67-
family=SocketPoolContants.AF_INET,
68-
type=SocketPoolContants.SOCK_STREAM,
63+
family=AF_INET,
64+
type=SOCK_STREAM,
6965
proto=0,
7066
fileno=None,
7167
):

0 commit comments

Comments
 (0)