From 85288886918150f29a9d4f23cece721b54789693 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 8 Jun 2023 10:37:44 +0300 Subject: [PATCH] Update multiprocessing.pyi for Python3.12 (#10279) --- stdlib/multiprocessing/connection.pyi | 7 ++++++- stdlib/multiprocessing/queues.pyi | 2 ++ tests/stubtest_allowlists/py312.txt | 2 -- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/stdlib/multiprocessing/connection.pyi b/stdlib/multiprocessing/connection.pyi index d03437371..28696fe6a 100644 --- a/stdlib/multiprocessing/connection.pyi +++ b/stdlib/multiprocessing/connection.pyi @@ -52,7 +52,12 @@ class Listener: self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... -def deliver_challenge(connection: Connection, authkey: bytes) -> None: ... +if sys.version_info >= (3, 12): + def deliver_challenge(connection: Connection, authkey: bytes, digest_name: str = "sha256") -> None: ... + +else: + def deliver_challenge(connection: Connection, authkey: bytes) -> None: ... + def answer_challenge(connection: Connection, authkey: bytes) -> None: ... def wait( object_list: Iterable[Connection | socket.socket | int], timeout: float | None = None diff --git a/stdlib/multiprocessing/queues.pyi b/stdlib/multiprocessing/queues.pyi index a26ab7173..8e72d15f2 100644 --- a/stdlib/multiprocessing/queues.pyi +++ b/stdlib/multiprocessing/queues.pyi @@ -22,6 +22,8 @@ class Queue(Generic[_T]): def close(self) -> None: ... def join_thread(self) -> None: ... def cancel_join_thread(self) -> None: ... + if sys.version_info >= (3, 12): + def __class_getitem__(cls, __item: Any) -> GenericAlias: ... class JoinableQueue(Queue[_T]): def task_done(self) -> None: ... diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index fa2fb7314..6cb57d1da 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -77,8 +77,6 @@ logging.Logger.getChildren logging.__all__ logging.getHandlerByName logging.getHandlerNames -multiprocessing.connection.deliver_challenge -multiprocessing.queues.Queue.__class_getitem__ ntpath.__all__ ntpath.isjunction ntpath.splitroot