Skip to content

Commit 150bfc9

Browse files
author
BiffoBear
committed
Refactored soc_type to type.
1 parent 9cf28e5 commit 150bfc9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adafruit_wiznet5k/adafruit_wiznet5k_socket.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# SPDX-FileCopyrightText: 2020 Brent Rubell for Adafruit Industries
33
#
44
# SPDX-License-Identifier: MIT
5-
5+
#
6+
# CPython uses type as an argument in socket.socket, so disable checking in Pylint
7+
# pylint: disable=redefined-builtin
68
"""
79
`adafruit_wiznet5k_socket`
810
================================================================================
@@ -154,7 +156,7 @@ def getaddrinfo(
154156
host: str,
155157
port: int,
156158
family: int = 0,
157-
soc_type: int = 0,
159+
type: int = 0,
158160
proto: int = 0,
159161
flags: int = 0,
160162
) -> List[Tuple[int, int, int, str, Tuple[str, int]]]:
@@ -166,7 +168,7 @@ def getaddrinfo(
166168
None.
167169
:param int port: Port number to connect to (0 - 65536).
168170
:param int family: Ignored and hardcoded as 0x03 (the only family implemented) by the function.
169-
:param int soc_type: The type of socket, either SOCK_STREAM (0x21) for TCP or SOCK_DGRAM (0x02)
171+
:param int type: The type of socket, either SOCK_STREAM (0x21) for TCP or SOCK_DGRAM (0x02)
170172
for UDP, defaults to 0.
171173
:param int proto: Unused in this implementation of socket.
172174
:param int flags: Unused in this implementation of socket.
@@ -181,7 +183,7 @@ def getaddrinfo(
181183
raise ValueError("Port must be an integer")
182184
if not _is_ipv4_string(host):
183185
host = gethostbyname(host)
184-
return [(AF_INET, soc_type, proto, "", (host, port))]
186+
return [(AF_INET, type, proto, "", (host, port))]
185187

186188

187189
def gethostbyname(hostname: str) -> str:

0 commit comments

Comments
 (0)