Skip to content

Commit 1b2e7aa

Browse files
committed
Fix import and make the code PEP8 compliant
1 parent 801cf3f commit 1b2e7aa

File tree

1,367 files changed

+6862
-4599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,367 files changed

+6862
-4599
lines changed

Lib/_aix_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def _read_cmd_output(commandstring, capture_stderr=False):
1010
# Similar to os.popen(commandstring, "r").read(),
1111
# but without actually using os.popen because that
1212
# function is not usable during python bootstrap.
13-
import os
1413
import contextlib
14+
import os
1515
fp = open("/tmp/_aix_support.%s"%(
1616
os.getpid(),), "w+b")
1717

Lib/_ast_unparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from _ast import *
55
from ast import NodeVisitor
66
from contextlib import contextmanager, nullcontext
7-
from enum import IntEnum, auto, _simple_enum
7+
from enum import IntEnum, _simple_enum, auto
88

99
# Large float and imaginary literals get turned into infinities in the AST.
1010
# We unparse those infinities to INFSTR.

Lib/_collections_abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#
3333
#######################################################################
3434

35-
from abc import ABCMeta, abstractmethod
3635
import sys
36+
from abc import ABCMeta, abstractmethod
3737

3838
GenericAlias = type(list[int])
3939
EllipsisType = type(...)

Lib/_colorize.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import io
22
import os
33
import sys
4-
54
from collections.abc import Callable, Iterator, Mapping
6-
from dataclasses import dataclass, field, Field
5+
from dataclasses import Field, dataclass, field
76

87
COLORIZE = True
98

109

1110
# types
1211
if False:
13-
from typing import IO, Self, ClassVar
12+
from typing import IO, ClassVar, Self
1413
_theme: Theme
1514

1615

Lib/_ios_support.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
2+
23
try:
3-
from ctypes import cdll, c_void_p, c_char_p, util
4+
from ctypes import c_char_p, c_void_p, cdll, util
45
except ImportError:
56
# ctypes is an optional module. If it's not present, we're limited in what
67
# we can tell about the system, but we don't want to prevent the module

Lib/_py_warnings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""Python part of the warnings subsystem."""
22

3-
import sys
43
import _contextvars
54
import _thread
6-
5+
import sys
76

87
__all__ = ["warn", "warn_explicit", "showwarning",
98
"formatwarning", "filterwarnings", "simplefilter",
@@ -836,7 +835,8 @@ def _warn_unawaited_coroutine(coro):
836835
f"coroutine '{coro.__qualname__}' was never awaited\n"
837836
]
838837
if coro.cr_origin is not None:
839-
import linecache, traceback
838+
import linecache
839+
import traceback
840840
def extract():
841841
for filename, lineno, funcname in reversed(coro.cr_origin):
842842
line = linecache.getline(filename, lineno)

Lib/_pydatetime.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
__name__ = "datetime"
77

88

9-
import time as _time
109
import math as _math
1110
import sys
11+
import time as _time
1212
from operator import index as _index
1313

14+
1415
def _cmp(x, y):
1516
return 0 if x == y else 1 if x > y else -1
1617

Lib/_pydecimal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6080,6 +6080,7 @@ def _convert_for_comparison(self, other, equality_op=False):
60806080
# lookahead expression '(?=\d|\.\d)' checks this.
60816081

60826082
import re
6083+
60836084
_parser = re.compile(r""" # A numeric string consists of:
60846085
# \s*
60856086
(?P<sign>[-+])? # an optional sign, followed by either...

Lib/_pyio.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,30 @@
22
Python implementation of the io module.
33
"""
44

5-
import os
65
import abc
76
import codecs
87
import errno
8+
import os
99
import stat
1010
import sys
11+
1112
# Import _thread instead of threading to reduce startup cost
1213
from _thread import allocate_lock as Lock
14+
1315
if sys.platform in {'win32', 'cygwin'}:
1416
from msvcrt import setmode as _setmode
1517
else:
1618
_setmode = None
1719

1820
import io
19-
from io import (__all__, SEEK_SET, SEEK_CUR, SEEK_END, Reader, Writer) # noqa: F401
21+
from io import ( # noqa: F401
22+
SEEK_CUR,
23+
SEEK_END,
24+
SEEK_SET,
25+
Reader,
26+
Writer,
27+
__all__,
28+
)
2029

2130
valid_seek_flags = {0, 1, 2} # Hardwired values
2231
if hasattr(os, 'SEEK_HOLE') :

Lib/_pylong.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
tricky or non-obvious code is not worth it. For people looking for
1313
maximum performance, they should use something like gmpy2."""
1414

15-
import re
1615
import decimal
16+
import re
17+
1718
try:
1819
import _decimal
1920
except ImportError:
@@ -265,6 +266,7 @@ def inner(a, b):
265266
# key 1 - quotient had to be boosted by 1, one time
266267
# key 999 - one adjustment wasn't enough, so fell back to divmod
267268
from collections import defaultdict
269+
268270
_spread = defaultdict(int)
269271
del defaultdict
270272

0 commit comments

Comments
 (0)