From 7ba59719b6e7a2ceb944fa545eca9e2fa05c5819 Mon Sep 17 00:00:00 2001 From: Rune Tynan Date: Wed, 27 May 2020 23:14:00 -0400 Subject: [PATCH] Fix asyncio IocpProactor version availability (#4121) --- stdlib/3/asyncio/windows_events.pyi | 6 ++++-- tests/stubtest_whitelists/win32-py35.txt | 4 ---- tests/stubtest_whitelists/win32-py36.txt | 4 ---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/stdlib/3/asyncio/windows_events.pyi b/stdlib/3/asyncio/windows_events.pyi index cd524dc78..8b12a9f35 100644 --- a/stdlib/3/asyncio/windows_events.pyi +++ b/stdlib/3/asyncio/windows_events.pyi @@ -44,11 +44,13 @@ class IocpProactor: def set_loop(self, loop: events.AbstractEventLoop) -> None: ... def select(self, timeout: Optional[int] = ...) -> List[futures.Future[Any]]: ... def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ... - def recv_into(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ... + if sys.version_info >= (3, 7): + def recv_into(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ... def send(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ... def accept(self, listener: socket.socket) -> futures.Future[Any]: ... def connect(self, conn: socket.socket, address: bytes) -> futures.Future[Any]: ... - def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... + if sys.version_info >= (3, 7): + def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ... async def connect_pipe(self, address: bytes) -> windows_utils.PipeHandle: ... def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: Optional[int] = ...) -> bool: ... diff --git a/tests/stubtest_whitelists/win32-py35.txt b/tests/stubtest_whitelists/win32-py35.txt index c73b3a611..3a6658e1e 100644 --- a/tests/stubtest_whitelists/win32-py35.txt +++ b/tests/stubtest_whitelists/win32-py35.txt @@ -2,10 +2,6 @@ _codecs.oem_decode _codecs.oem_encode _winapi.GetACP _winapi.GetFileType -asyncio.IocpProactor.recv_into -asyncio.IocpProactor.sendfile -asyncio.windows_events.IocpProactor.recv_into -asyncio.windows_events.IocpProactor.sendfile ntpath.splitunc os.path.splitunc os.path.splitunc diff --git a/tests/stubtest_whitelists/win32-py36.txt b/tests/stubtest_whitelists/win32-py36.txt index b25220672..41e788ad9 100644 --- a/tests/stubtest_whitelists/win32-py36.txt +++ b/tests/stubtest_whitelists/win32-py36.txt @@ -1,9 +1,5 @@ _winapi.GetACP _winapi.GetFileType -asyncio.IocpProactor.recv_into -asyncio.IocpProactor.sendfile -asyncio.windows_events.IocpProactor.recv_into -asyncio.windows_events.IocpProactor.sendfile hashlib.scrypt ntpath.splitunc os.path.splitunc