Fix allowlist entries in asyncio.windows_events (#10824)

And fix the return value of return value of `IocpProactor.recvfrom_into()`, which was incorrect

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Alex Waygood
2023-10-02 16:04:11 +01:00
committed by GitHub
parent 54d825af59
commit 860e34eec9
2 changed files with 8 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
import socket
import sys
from _typeshed import Incomplete, WriteableBuffer
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
from collections.abc import Callable
from typing import IO, Any, ClassVar, NoReturn
from typing_extensions import Literal
@@ -48,6 +48,12 @@ if sys.platform == "win32":
def select(self, timeout: int | None = None) -> list[futures.Future[Any]]: ...
def recv(self, conn: socket.socket, nbytes: int, flags: int = 0) -> futures.Future[bytes]: ...
def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ...
def recvfrom(
self, conn: socket.socket, nbytes: int, flags: int = 0
) -> futures.Future[tuple[bytes, socket._RetAddress]]: ...
def sendto(
self, conn: socket.socket, buf: ReadableBuffer, flags: int = 0, addr: socket._Address | None = None
) -> futures.Future[int]: ...
def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ...
def accept(self, listener: socket.socket) -> futures.Future[Any]: ...
def connect(
@@ -63,7 +69,7 @@ if sys.platform == "win32":
if sys.version_info >= (3, 11):
def recvfrom_into(
self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0
) -> tuple[int, socket._RetAddress]: ...
) -> futures.Future[tuple[int, socket._RetAddress]]: ...
SelectorEventLoop = _WindowsSelectorEventLoop
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):