Skip to content

Commit

Permalink
Update asyncio.base_events for py312 (#10543)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Aug 8, 2023
1 parent a578355 commit 4990da6
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
47 changes: 45 additions & 2 deletions stdlib/asyncio/base_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,48 @@ class BaseEventLoop(AbstractEventLoop):
flags: int = 0,
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = 0) -> tuple[str, str]: ...
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 12):
@overload
async def create_connection(
self,
protocol_factory: Callable[[], _ProtocolT],
host: str = ...,
port: int = ...,
*,
ssl: _SSLContext = None,
family: int = 0,
proto: int = 0,
flags: int = 0,
sock: None = None,
local_addr: tuple[str, int] | None = None,
server_hostname: str | None = None,
ssl_handshake_timeout: float | None = None,
ssl_shutdown_timeout: float | None = None,
happy_eyeballs_delay: float | None = None,
interleave: int | None = None,
all_errors: bool = False,
) -> tuple[Transport, _ProtocolT]: ...
@overload
async def create_connection(
self,
protocol_factory: Callable[[], _ProtocolT],
host: None = None,
port: None = None,
*,
ssl: _SSLContext = None,
family: int = 0,
proto: int = 0,
flags: int = 0,
sock: socket,
local_addr: None = None,
server_hostname: str | None = None,
ssl_handshake_timeout: float | None = None,
ssl_shutdown_timeout: float | None = None,
happy_eyeballs_delay: float | None = None,
interleave: int | None = None,
all_errors: bool = False,
) -> tuple[Transport, _ProtocolT]: ...
elif sys.version_info >= (3, 11):
@overload
async def create_connection(
self,
Expand Down Expand Up @@ -426,5 +467,7 @@ class BaseEventLoop(AbstractEventLoop):
# Debug flag management.
def get_debug(self) -> bool: ...
def set_debug(self, enabled: bool) -> None: ...
if sys.version_info >= (3, 9):
if sys.version_info >= (3, 12):
async def shutdown_default_executor(self, timeout: float | None = None) -> None: ...
elif sys.version_info >= (3, 9):
async def shutdown_default_executor(self) -> None: ...
4 changes: 0 additions & 4 deletions tests/stubtest_allowlists/py312.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Uncategorised, from Python 3.12
argparse.BooleanOptionalAction.__init__
asyncio.BaseEventLoop.create_connection
asyncio.BaseEventLoop.shutdown_default_executor
asyncio.base_events.BaseEventLoop.create_connection
asyncio.base_events.BaseEventLoop.shutdown_default_executor
asyncio.create_eager_task_factory
asyncio.eager_task_factory
asyncio.tasks.__all__
Expand Down

0 comments on commit 4990da6

Please sign in to comment.