Skip to content

Commit fbb89f9

Browse files
authored
Fix isort w.r.t. _ast/_collections_abc/_tracemalloc/_warnings (#6329)
1 parent 25ba2ba commit fbb89f9

File tree

8 files changed

+12
-15
lines changed

8 files changed

+12
-15
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ extra_standard_library = [
1313
"typing_extensions",
1414
"_typeshed",
1515
# Extra modules not recognized by isort
16+
"_ast",
17+
"_collections_abc",
1618
"_compression",
1719
"_csv",
1820
"_curses",
1921
"_markupbase",
2022
"_random",
2123
"_tkinter",
24+
"_tracemalloc",
25+
"_warnings",
2226
"_weakrefset",
2327
"genericpath",
2428
"opcode",

stdlib/@python2/ast.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
# from _ast below when loaded in an unorthodox way by the Dropbox
55
# internal Bazel integration.
66
import typing as _typing
7-
from typing import Any, Iterator
8-
97
from _ast import *
108
from _ast import AST, Module
9+
from typing import Any, Iterator
1110

1211
def parse(source: str | unicode, filename: str | unicode = ..., mode: str | unicode = ...) -> Module: ...
1312
def copy_location(new_node: AST, old_node: AST) -> AST: ...

stdlib/@python2/warnings.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
from _warnings import warn as warn, warn_explicit as warn_explicit
12
from types import ModuleType, TracebackType
23
from typing import List, TextIO, Type, overload
34
from typing_extensions import Literal
45

5-
from _warnings import warn as warn, warn_explicit as warn_explicit
6-
76
def showwarning(
87
message: Warning | str, category: Type[Warning], filename: str, lineno: int, file: TextIO | None = ..., line: str | None = ...
98
) -> None: ...

stdlib/ast.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
# sys.
99
import sys
1010
import typing as _typing
11+
from _ast import * # type: ignore
1112
from typing import Any, Iterator, TypeVar, overload
1213
from typing_extensions import Literal
1314

14-
from _ast import * # type: ignore
15-
1615
if sys.version_info >= (3, 8):
1716
class Num(Constant):
1817
value: complex

stdlib/builtins.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import sys
22
import types
3+
from _ast import AST
4+
from _collections_abc import dict_items, dict_keys, dict_values
35
from _typeshed import (
46
OpenBinaryMode,
57
OpenBinaryModeReading,
@@ -59,9 +61,6 @@ from typing import (
5961
)
6062
from typing_extensions import Literal, SupportsIndex, TypeGuard, final
6163

62-
from _ast import AST
63-
from _collections_abc import dict_items, dict_keys, dict_values
64-
6564
if sys.version_info >= (3, 9):
6665
from types import GenericAlias
6766

stdlib/collections/__init__.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import sys
2+
from _collections_abc import dict_items, dict_keys, dict_values
23
from _typeshed import Self
34
from typing import Any, Dict, Generic, NoReturn, Tuple, Type, TypeVar, overload
45
from typing_extensions import final
56

6-
from _collections_abc import dict_items, dict_keys, dict_values
7-
87
if sys.version_info >= (3, 10):
98
from typing import Callable, Iterable, Iterator, Mapping, MutableMapping, MutableSequence, Reversible, Sequence
109
else:

stdlib/tracemalloc.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sys
2-
from typing import Optional, Sequence, Tuple, Union, overload
3-
42
from _tracemalloc import *
3+
from typing import Optional, Sequence, Tuple, Union, overload
54

65
def get_object_traceback(obj: object) -> Traceback | None: ...
76
def take_snapshot() -> Snapshot: ...

stdlib/warnings.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
from _warnings import warn as warn, warn_explicit as warn_explicit
12
from types import ModuleType, TracebackType
23
from typing import Any, Sequence, TextIO, Type, overload
34
from typing_extensions import Literal
45

5-
from _warnings import warn as warn, warn_explicit as warn_explicit
6-
76
_ActionKind = Literal["default", "error", "ignore", "always", "module", "once"]
87

98
filters: Sequence[tuple[str, str | None, Type[Warning], str | None, int]] # undocumented, do not mutate

0 commit comments

Comments
 (0)