Skip to content

Commit 1798bad

Browse files
authored
update for the new patch releases (#13196)
1 parent d0d0496 commit 1798bad

File tree

11 files changed

+42
-30
lines changed

11 files changed

+42
-30
lines changed

stdlib/@tests/stubtest_allowlists/darwin-py313.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
# >= 3.13
33
# =======
44

5-
# TODO: New in 3.13.1
6-
_socket.SO_BINDTODEVICE
7-
socket.__all__
8-
socket.SO_BINDTODEVICE
9-
105
# Depends on HAVE_NCURSESW and how we install CPython,
116
# should be removed when 3.13 will be officially released:
127
_?curses.unget_wch

stdlib/@tests/stubtest_allowlists/py312.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
# New errors in Python 3.12
33
# =========================
44

5-
# TODO: New in 3.12.8
6-
argparse.ArgumentParser._parse_known_args
7-
concurrent.futures.process._SafeQueue.__init__
8-
pickletools.read_stringnl
9-
token.__all__
10-
tokenize.__all__
11-
125

136
# =======
147
# >= 3.12

stdlib/@tests/stubtest_allowlists/py313.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
# New errors in Python 3.13
33
# =========================
44

5-
# TODO: New in 3.13.1
6-
argparse.ArgumentParser._parse_known_args
7-
codeop.Compile.__call__
8-
concurrent.futures.process._SafeQueue.__init__
9-
pickletools.read_stringnl
10-
token.__all__
11-
tokenize.__all__
12-
135

146
# =======
157
# >= 3.13

stdlib/_socket.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ if sys.platform == "win32":
7878
SO_EXCLUSIVEADDRUSE: int
7979
if sys.platform != "win32":
8080
SO_REUSEPORT: int
81+
if sys.platform != "darwin" or sys.version_info >= (3, 13):
82+
SO_BINDTODEVICE: int
83+
8184
if sys.platform != "win32" and sys.platform != "darwin":
82-
SO_BINDTODEVICE: int
8385
SO_DOMAIN: int
8486
SO_MARK: int
8587
SO_PASSCRED: int

stdlib/argparse.pyi

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,13 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
237237
# undocumented
238238
def _get_optional_actions(self) -> list[Action]: ...
239239
def _get_positional_actions(self) -> list[Action]: ...
240-
def _parse_known_args(self, arg_strings: list[str], namespace: Namespace) -> tuple[Namespace, list[str]]: ...
240+
if sys.version_info >= (3, 12):
241+
def _parse_known_args(
242+
self, arg_strings: list[str], namespace: Namespace, intermixed: bool
243+
) -> tuple[Namespace, list[str]]: ...
244+
else:
245+
def _parse_known_args(self, arg_strings: list[str], namespace: Namespace) -> tuple[Namespace, list[str]]: ...
246+
241247
def _read_args_from_files(self, arg_strings: list[str]) -> list[str]: ...
242248
def _match_argument(self, action: Action, arg_strings_pattern: str) -> int: ...
243249
def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> list[int]: ...

stdlib/codeop.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from types import CodeType
23

34
__all__ = ["compile_command", "Compile", "CommandCompiler"]
@@ -6,7 +7,10 @@ def compile_command(source: str, filename: str = "<input>", symbol: str = "singl
67

78
class Compile:
89
flags: int
9-
def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ...
10+
if sys.version_info >= (3, 13):
11+
def __call__(self, source: str, filename: str, symbol: str, flags: int = 0) -> CodeType: ...
12+
else:
13+
def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ...
1014

1115
class CommandCompiler:
1216
compiler: Compile

stdlib/concurrent/futures/process.pyi

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,19 @@ class _CallItem:
7272

7373
class _SafeQueue(Queue[Future[Any]]):
7474
pending_work_items: dict[int, _WorkItem[Any]]
75-
shutdown_lock: Lock
75+
if sys.version_info < (3, 12):
76+
shutdown_lock: Lock
7677
thread_wakeup: _ThreadWakeup
77-
if sys.version_info >= (3, 9):
78+
if sys.version_info >= (3, 12):
79+
def __init__(
80+
self,
81+
max_size: int | None = 0,
82+
*,
83+
ctx: BaseContext,
84+
pending_work_items: dict[int, _WorkItem[Any]],
85+
thread_wakeup: _ThreadWakeup,
86+
) -> None: ...
87+
elif sys.version_info >= (3, 9):
7888
def __init__(
7989
self,
8090
max_size: int | None = 0,

stdlib/pickletools.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from collections.abc import Callable, Iterator, MutableMapping
23
from typing import IO, Any
34
from typing_extensions import TypeAlias
@@ -40,7 +41,13 @@ def read_uint8(f: IO[bytes]) -> int: ...
4041

4142
uint8: ArgumentDescriptor
4243

43-
def read_stringnl(f: IO[bytes], decode: bool = True, stripquotes: bool = True) -> bytes | str: ...
44+
if sys.version_info >= (3, 12):
45+
def read_stringnl(
46+
f: IO[bytes], decode: bool = True, stripquotes: bool = True, *, encoding: str = "latin-1"
47+
) -> bytes | str: ...
48+
49+
else:
50+
def read_stringnl(f: IO[bytes], decode: bool = True, stripquotes: bool = True) -> bytes | str: ...
4451

4552
stringnl: ArgumentDescriptor
4653

stdlib/socket.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ if sys.platform != "win32" and sys.platform != "darwin":
367367
IP_TRANSPARENT as IP_TRANSPARENT,
368368
IPX_TYPE as IPX_TYPE,
369369
SCM_CREDENTIALS as SCM_CREDENTIALS,
370-
SO_BINDTODEVICE as SO_BINDTODEVICE,
371370
SO_DOMAIN as SO_DOMAIN,
372371
SO_MARK as SO_MARK,
373372
SO_PASSCRED as SO_PASSCRED,
@@ -396,7 +395,6 @@ if sys.platform != "win32" and sys.platform != "darwin":
396395
__all__ += [
397396
"IP_TRANSPARENT",
398397
"SCM_CREDENTIALS",
399-
"SO_BINDTODEVICE",
400398
"SO_DOMAIN",
401399
"SO_MARK",
402400
"SO_PASSCRED",
@@ -517,6 +515,11 @@ if sys.platform != "win32":
517515
"IPV6_RTHDRDSTOPTS",
518516
]
519517

518+
if sys.platform != "darwin" or sys.version_info >= (3, 13):
519+
from _socket import SO_BINDTODEVICE as SO_BINDTODEVICE
520+
521+
__all__ += ["SO_BINDTODEVICE"]
522+
520523
if sys.platform != "darwin" and sys.platform != "linux":
521524
if sys.platform != "win32" or sys.version_info >= (3, 9):
522525
from _socket import BDADDR_ANY as BDADDR_ANY, BDADDR_LOCAL as BDADDR_LOCAL, BTPROTO_RFCOMM as BTPROTO_RFCOMM

stdlib/token.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ if sys.version_info >= (3, 10):
7676
__all__ += ["SOFT_KEYWORD"]
7777

7878
if sys.version_info >= (3, 12):
79-
__all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START"]
79+
__all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START", "EXACT_TOKEN_TYPES"]
8080

8181
ENDMARKER: int
8282
NAME: int

stdlib/tokenize.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if sys.version_info >= (3, 10):
8888
__all__ += ["SOFT_KEYWORD"]
8989

9090
if sys.version_info >= (3, 12):
91-
__all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START"]
91+
__all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START", "EXACT_TOKEN_TYPES"]
9292

9393
if sys.version_info >= (3, 13):
9494
__all__ += ["TokenError", "open"]

0 commit comments

Comments
 (0)