From bd55cae8b61189440e961d3de285f0bac6355301 Mon Sep 17 00:00:00 2001 From: tikki <601529+tikki@users.noreply.github.com> Date: Fri, 31 Jan 2020 02:45:38 +0000 Subject: [PATCH] fix arg name to socket.getaddrinfo for py3 (#3689) --- stdlib/2and3/socket.pyi | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/stdlib/2and3/socket.pyi b/stdlib/2and3/socket.pyi index 49b99906c..2535cea38 100644 --- a/stdlib/2and3/socket.pyi +++ b/stdlib/2and3/socket.pyi @@ -732,12 +732,20 @@ if sys.platform == 'win32' and sys.version_info >= (3, 3): # the 5th tuple item is an address # TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers # https://github.com/python/mypy/issues/2509 -def getaddrinfo(host: Optional[Union[bytearray, bytes, Text]], - port: Union[str, int, None], - family: int = ..., - socktype: int = ..., - proto: int = ..., - flags: int = ...) -> List[Tuple[AddressFamily, SocketKind, int, str, Tuple[Any, ...]]]: ... +if sys.version_info >= (3,): + def getaddrinfo(host: Optional[Union[bytearray, bytes, Text]], + port: Union[str, int, None], + family: int = ..., + type: int = ..., + proto: int = ..., + flags: int = ...) -> List[Tuple[AddressFamily, SocketKind, int, str, Tuple[Any, ...]]]: ... +else: + def getaddrinfo(host: Optional[Union[bytearray, bytes, Text]], + port: Union[str, int, None], + family: int = ..., + socktype: int = ..., + proto: int = ..., + flags: int = ...) -> List[Tuple[AddressFamily, SocketKind, int, str, Tuple[Any, ...]]]: ... def getfqdn(name: str = ...) -> str: ... def gethostbyname(hostname: str) -> str: ...