From e64939c5ed1579c9230bd91ad7a2539ff1428f1a Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sat, 3 Jun 2023 09:57:31 +0300 Subject: [PATCH 1/4] Update sys.pyi for Python3.12 Source: https://github.com/python/cpython/blob/3.12/Python/sysmodule.c Docs: https://github.com/python/cpython/blob/3.12/Doc/library/sys.rst --- stdlib/sys.pyi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stdlib/sys.pyi b/stdlib/sys.pyi index 313ea5877c6e..323f2e7ddcee 100644 --- a/stdlib/sys.pyi +++ b/stdlib/sys.pyi @@ -359,3 +359,10 @@ if sys.version_info < (3, 8): # as part of the response to CVE-2020-10735 def set_int_max_str_digits(maxdigits: int) -> None: ... def get_int_max_str_digits() -> int: ... + +if sys.version_info > (3, 12): + def getunicodeinternedsize() -> int: ... + if sys.platform == "linux": + def activate_stack_trampoline(__backend: str) -> None: ... + def deactivate_stack_trampoline() -> None: ... + def is_stack_trampoline_active() -> bool: ... From 5c98c3e7487691b640000dfeb237af1c0dc4b913 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sat, 3 Jun 2023 10:00:56 +0300 Subject: [PATCH 2/4] =?UTF-8?q?=D0=95=D0=BD=D0=B7=D1=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stdlib/sys.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/sys.pyi b/stdlib/sys.pyi index 323f2e7ddcee..0e949de672cf 100644 --- a/stdlib/sys.pyi +++ b/stdlib/sys.pyi @@ -360,7 +360,7 @@ if sys.version_info < (3, 8): def set_int_max_str_digits(maxdigits: int) -> None: ... def get_int_max_str_digits() -> int: ... -if sys.version_info > (3, 12): +if sys.version_info >= (3, 12): def getunicodeinternedsize() -> int: ... if sys.platform == "linux": def activate_stack_trampoline(__backend: str) -> None: ... From 95ee3bf4ea20406f6bcd44f5c71a89a67df69459 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 4 Jun 2023 14:16:13 +0100 Subject: [PATCH 3/4] Remove unused allowlist entries --- tests/stubtest_allowlists/py312.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index 3e14f8b9233c..ed209d1d447e 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -185,10 +185,6 @@ ssl.OP_LEGACY_SERVER_CONNECT ssl.Options.OP_LEGACY_SERVER_CONNECT ssl.RAND_pseudo_bytes ssl.wrap_socket -sys.activate_stack_trampoline -sys.deactivate_stack_trampoline -sys.getunicodeinternedsize -sys.is_stack_trampoline_active tarfile.AbsoluteLinkError tarfile.AbsolutePathError tarfile.FilterError From f627983910a3e4236a8cc4e21a0a0fab2ce6f9e3 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Mon, 5 Jun 2023 10:54:04 +0300 Subject: [PATCH 4/4] Fix CI --- stdlib/sys.pyi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stdlib/sys.pyi b/stdlib/sys.pyi index 0e949de672cf..ca049124053a 100644 --- a/stdlib/sys.pyi +++ b/stdlib/sys.pyi @@ -362,7 +362,10 @@ def get_int_max_str_digits() -> int: ... if sys.version_info >= (3, 12): def getunicodeinternedsize() -> int: ... + def deactivate_stack_trampoline() -> None: ... + def is_stack_trampoline_active() -> bool: ... + # It always exists, but raises on non-linux platforms: if sys.platform == "linux": def activate_stack_trampoline(__backend: str) -> None: ... - def deactivate_stack_trampoline() -> None: ... - def is_stack_trampoline_active() -> bool: ... + else: + def activate_stack_trampoline(__backend: str) -> NoReturn: ...