From f18c02a37d7a6dec63fe456122d0c2c1099369cb Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Fri, 9 Feb 2024 09:08:37 +0000 Subject: [PATCH] Fix stubtest for Python 3.11.8 and 3.12.2 --- stdlib/asyncio/sslproto.pyi | 3 ++- tests/stubtest_allowlists/py312.txt | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stdlib/asyncio/sslproto.pyi b/stdlib/asyncio/sslproto.pyi index b56b1547db8a..04197c8d2978 100644 --- a/stdlib/asyncio/sslproto.pyi +++ b/stdlib/asyncio/sslproto.pyi @@ -156,9 +156,10 @@ class SSLProtocol(_SSLProtocolBase): def _check_handshake_timeout(self) -> None: ... def _on_handshake_complete(self, handshake_exc: BaseException | None) -> None: ... def _fatal_error(self, exc: BaseException, message: str = "Fatal error on transport") -> None: ... - def _abort(self) -> None: ... if sys.version_info >= (3, 11): + def _abort(self, exc: BaseException | None) -> None: ... def get_buffer(self, n: int) -> memoryview: ... else: + def _abort(self) -> None: ... def _finalize(self) -> None: ... def _process_write_backlog(self) -> None: ... diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index 553717e306f5..aef0bdc20bd6 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -124,3 +124,7 @@ typing.SupportsAbs.__type_params__ typing.SupportsRound.__type_params__ typing_extensions.SupportsAbs.__type_params__ typing_extensions.SupportsRound.__type_params__ + +# Dunder that exists on all runtime-checkable protocols on py312+ +# TODO teach stubtest about this so we don't have to allowlist it +.+\.__non_callable_proto_members__