mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fix stubtest failures for socket on windows (#4102)
This commit is contained in:
@@ -661,7 +661,7 @@ class socket:
|
||||
def recv(self, bufsize: int, flags: int = ...) -> bytes: ...
|
||||
def recvfrom(self, bufsize: int, flags: int = ...) -> Tuple[bytes, _RetAddress]: ...
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
if sys.version_info >= (3, 3) and sys.platform != "win32":
|
||||
def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> Tuple[bytes, List[_CMSG], int, Any]: ...
|
||||
def recvmsg_into(self,
|
||||
__buffers: Iterable[_WriteBuffer],
|
||||
@@ -675,7 +675,7 @@ class socket:
|
||||
def sendto(self, data: bytes, address: _Address) -> int: ...
|
||||
@overload
|
||||
def sendto(self, data: bytes, flags: int, address: _Address) -> int: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
if sys.version_info >= (3, 3) and sys.platform != "win32":
|
||||
def sendmsg(self,
|
||||
__buffers: Iterable[bytes],
|
||||
__ancdata: Iterable[_CMSG] = ...,
|
||||
@@ -727,7 +727,7 @@ if sys.version_info >= (3, 8):
|
||||
def fromfd(fd: int, family: int, type: int, proto: int = ...) -> socket: ...
|
||||
|
||||
if sys.platform == 'win32' and sys.version_info >= (3, 3):
|
||||
def fromshare(data: bytes) -> socket: ...
|
||||
def fromshare(info: bytes) -> socket: ...
|
||||
|
||||
# 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
|
||||
@@ -771,7 +771,8 @@ if sys.version_info >= (3, 3):
|
||||
def getdefaulttimeout() -> Optional[float]: ...
|
||||
def setdefaulttimeout(timeout: Optional[float]) -> None: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def sethostname(name: str) -> None: ...
|
||||
if sys.platform != "win32":
|
||||
def sethostname(name: str) -> None: ...
|
||||
def if_nameindex() -> List[Tuple[int, str]]: ...
|
||||
def if_nametoindex(name: str) -> int: ...
|
||||
def if_indextoname(index: int) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user