socket: constructor accepts bytes on Windows (#9095)

d04899abb0/Modules/socketmodule.c (L5318)

This is used in `socket.fromshare`. It must be bytes, not some other buffer.
This commit is contained in:
Jelle Zijlstra
2022-11-10 07:10:44 -08:00
committed by GitHub
parent cc7ac01a3e
commit c7820b401d

View File

@@ -583,7 +583,11 @@ class socket:
def proto(self) -> int: ...
@property
def timeout(self) -> float | None: ...
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ...
if sys.platform == "win32":
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | bytes | None = ...) -> None: ...
else:
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ...
def bind(self, __address: _Address) -> None: ...
def close(self) -> None: ...
def connect(self, __address: _Address) -> None: ...