Update ast.main function for Python 3.14 (#13982)

This commit is contained in:
Semyon Moroz
2025-05-10 19:32:20 +00:00
committed by GitHub
parent d28270b19d
commit 725f7177b1
2 changed files with 7 additions and 3 deletions
@@ -251,7 +251,6 @@ ast.arg.__annotations_cache__
ast.arguments.__annotations_cache__
ast.comprehension.__annotations_cache__
ast.keyword.__annotations_cache__
ast.main
ast.match_case.__annotations_cache__
ast.withitem.__annotations_cache__
asyncio.__all__
+7 -2
View File
@@ -7,7 +7,7 @@ from _ast import (
PyCF_TYPE_COMMENTS as PyCF_TYPE_COMMENTS,
)
from _typeshed import ReadableBuffer, Unused
from collections.abc import Iterable, Iterator
from collections.abc import Iterable, Iterator, Sequence
from typing import Any, ClassVar, Generic, Literal, TypedDict, TypeVar as _TypeVar, overload
from typing_extensions import Self, Unpack, deprecated
@@ -2016,4 +2016,9 @@ class NodeTransformer(NodeVisitor):
# is also allowed in some cases -- this needs to be mapped.
def unparse(ast_obj: AST) -> str: ...
def main() -> None: ...
if sys.version_info >= (3, 14):
def main(args: Sequence[str] | None = None) -> None: ...
else:
def main() -> None: ...