Skip to content

Commit 7030b26

Browse files
authored
Fix stdlib stubtest on Python 3.14.9 and 3.15.1 (#16596)
1 parent 5cc604a commit 7030b26

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎stdlib/_remote_debugging.pyi‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ class BinaryWriter:
156156
) -> None: ...
157157
@property
158158
def total_samples(self) -> int: ...
159+
# Added in Python 3.15.1.
160+
@property
161+
def limit_reached(self) -> bool: ...
159162
def write_sample(self, stack_frames: list[InterpreterInfo], timestamp_us: int) -> None: ...
160163
def set_stats(
161164
self, /, duration_sec: float, sample_rate: float, error_rate: float | None = None, missed_samples: float | None = None

‎stdlib/email/_header_value_parser.pyi‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ class TokenList(list[TokenList | Terminal]):
4747
def as_ew_allowed(self) -> bool: ...
4848
@property
4949
def comments(self) -> list[str]: ...
50+
if sys.version_info >= (3, 14):
51+
# Added in Python 3.14.9 and 3.15.1.
52+
def contains_token_type(self, *token_types: str | None) -> bool: ...
53+
5054
def fold(self, *, policy: Policy) -> str: ...
5155
def pprint(self, indent: str = "") -> None: ...
5256
def ppstr(self, indent: str = "") -> str: ...
@@ -339,6 +343,10 @@ class Terminal(str):
339343
def pop_trailing_ws(self) -> None: ...
340344
@property
341345
def comments(self) -> list[str]: ...
346+
if sys.version_info >= (3, 14):
347+
# Added in Python 3.14.9 and 3.15.1.
348+
def contains_token_type(self, *token_types: str | None) -> bool: ...
349+
342350
def __getnewargs__(self) -> tuple[str, str]: ... # type: ignore[override]
343351

344352
class WhiteSpaceTerminal(Terminal):

‎stdlib/multiprocessing/context.pyi‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,12 @@ class Process(BaseProcess):
169169

170170
class DefaultContext(BaseContext):
171171
Process: ClassVar[type[Process]]
172-
def __init__(self, context: BaseContext) -> None: ...
172+
if sys.version_info >= (3, 14):
173+
# The context parameter became optional in Python 3.14.9 and 3.15.1.
174+
def __init__(self, context: BaseContext | None = None) -> None: ...
175+
else:
176+
def __init__(self, context: BaseContext) -> None: ...
177+
173178
def get_start_method(self, allow_none: bool = False) -> str: ...
174179
def get_all_start_methods(self) -> list[str]: ...
175180

0 commit comments

Comments
 (0)