From 9b09e37f9ef563c71a6398ab3ad553778f397d09 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 8 Jun 2023 09:44:17 +0300 Subject: [PATCH 1/3] Update multiprocessing.pyi for Python3.12 --- stdlib/multiprocessing/connection.pyi | 5 ++++- stdlib/multiprocessing/queues.pyi | 2 ++ tests/stubtest_allowlists/py312.txt | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/stdlib/multiprocessing/connection.pyi b/stdlib/multiprocessing/connection.pyi index d034373712e0..f4b3d76bd6c9 100644 --- a/stdlib/multiprocessing/connection.pyi +++ b/stdlib/multiprocessing/connection.pyi @@ -52,7 +52,10 @@ 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 a26ab7173232..37f78d9528cb 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 5df6b7235fc0..d853922746fd 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -78,8 +78,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 From a79f457a0827d25f0dbfa520136825ddeb089bc4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 8 Jun 2023 06:46:23 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/multiprocessing/connection.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/multiprocessing/connection.pyi b/stdlib/multiprocessing/connection.pyi index f4b3d76bd6c9..28696fe6a3a3 100644 --- a/stdlib/multiprocessing/connection.pyi +++ b/stdlib/multiprocessing/connection.pyi @@ -53,9 +53,11 @@ class Listener: ) -> None: ... if sys.version_info >= (3, 12): - def deliver_challenge(connection: Connection, authkey: bytes, digest_name: str = 'sha256') -> None: ... + 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 From 70c798a286868fb0604950ac8e95bb5e8a32ac47 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 8 Jun 2023 09:49:00 +0300 Subject: [PATCH 3/3] Fix CI --- stdlib/multiprocessing/queues.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/multiprocessing/queues.pyi b/stdlib/multiprocessing/queues.pyi index 37f78d9528cb..8e72d15f25f6 100644 --- a/stdlib/multiprocessing/queues.pyi +++ b/stdlib/multiprocessing/queues.pyi @@ -22,7 +22,7 @@ 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): + if sys.version_info >= (3, 12): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... class JoinableQueue(Queue[_T]):