Skip to content

Commit 725f717

Browse files
authored
Update ast.main function for Python 3.14 (#13982)
1 parent d28270b commit 725f717

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ ast.arg.__annotations_cache__
251251
ast.arguments.__annotations_cache__
252252
ast.comprehension.__annotations_cache__
253253
ast.keyword.__annotations_cache__
254-
ast.main
255254
ast.match_case.__annotations_cache__
256255
ast.withitem.__annotations_cache__
257256
asyncio.__all__

stdlib/ast.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ from _ast import (
77
PyCF_TYPE_COMMENTS as PyCF_TYPE_COMMENTS,
88
)
99
from _typeshed import ReadableBuffer, Unused
10-
from collections.abc import Iterable, Iterator
10+
from collections.abc import Iterable, Iterator, Sequence
1111
from typing import Any, ClassVar, Generic, Literal, TypedDict, TypeVar as _TypeVar, overload
1212
from typing_extensions import Self, Unpack, deprecated
1313

@@ -2016,4 +2016,9 @@ class NodeTransformer(NodeVisitor):
20162016
# is also allowed in some cases -- this needs to be mapped.
20172017

20182018
def unparse(ast_obj: AST) -> str: ...
2019-
def main() -> None: ...
2019+
2020+
if sys.version_info >= (3, 14):
2021+
def main(args: Sequence[str] | None = None) -> None: ...
2022+
2023+
else:
2024+
def main() -> None: ...

0 commit comments

Comments
 (0)