fix arg name to socket.getaddrinfo for py3 (#3689)

This commit is contained in:
tikki
2020-01-31 02:45:38 +00:00
committed by GitHub
parent 48d77d5f06
commit bd55cae8b6

View File

@@ -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: ...