Skip to content

Commit 7ba5971

Browse files
authored
Fix asyncio IocpProactor version availability (#4121)
1 parent 639771a commit 7ba5971

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

stdlib/3/asyncio/windows_events.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ class IocpProactor:
4444
def set_loop(self, loop: events.AbstractEventLoop) -> None: ...
4545
def select(self, timeout: Optional[int] = ...) -> List[futures.Future[Any]]: ...
4646
def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ...
47-
def recv_into(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ...
47+
if sys.version_info >= (3, 7):
48+
def recv_into(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ...
4849
def send(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ...
4950
def accept(self, listener: socket.socket) -> futures.Future[Any]: ...
5051
def connect(self, conn: socket.socket, address: bytes) -> futures.Future[Any]: ...
51-
def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ...
52+
if sys.version_info >= (3, 7):
53+
def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ...
5254
def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ...
5355
async def connect_pipe(self, address: bytes) -> windows_utils.PipeHandle: ...
5456
def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: Optional[int] = ...) -> bool: ...

tests/stubtest_whitelists/win32-py35.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ _codecs.oem_decode
22
_codecs.oem_encode
33
_winapi.GetACP
44
_winapi.GetFileType
5-
asyncio.IocpProactor.recv_into
6-
asyncio.IocpProactor.sendfile
7-
asyncio.windows_events.IocpProactor.recv_into
8-
asyncio.windows_events.IocpProactor.sendfile
95
ntpath.splitunc
106
os.path.splitunc
117
os.path.splitunc

tests/stubtest_whitelists/win32-py36.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
_winapi.GetACP
22
_winapi.GetFileType
3-
asyncio.IocpProactor.recv_into
4-
asyncio.IocpProactor.sendfile
5-
asyncio.windows_events.IocpProactor.recv_into
6-
asyncio.windows_events.IocpProactor.sendfile
73
hashlib.scrypt
84
ntpath.splitunc
95
os.path.splitunc

0 commit comments

Comments
 (0)