Skip to content

Commit e71c217

Browse files
Revert some leftovers from the old
1 parent 65fbf80 commit e71c217

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/ast.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
:license: Python License.
2222
"""
2323
from _ast import *
24-
lazy import re
25-
lazy import sys
2624
lazy from _colorize import can_colorize, get_theme
2725

2826

@@ -352,6 +350,8 @@ def _splitlines_no_ff(source, maxlines=None):
352350
"""
353351
global _line_pattern
354352
if _line_pattern is None:
353+
# lazily computed to speedup import time of `ast`
354+
import re
355355
_line_pattern = re.compile(r"(.*?(?:\r\n|\n|\r|$))")
356356

357357
lines = []
@@ -653,6 +653,7 @@ def unparse(ast_obj):
653653

654654
def main(args=None):
655655
import argparse
656+
import sys
656657

657658
parser = argparse.ArgumentParser(color=True)
658659
parser.add_argument('infile', nargs='?', default='-',

Lib/test/test_ast/test_ast.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3680,7 +3680,6 @@ def test_show_empty_flag(self):
36803680
self.check_output(source, expect, '--show-empty')
36813681

36823682

3683-
@support.force_not_colorized_test_class
36843683
class ASTOptimizationTests(unittest.TestCase):
36853684
def wrap_expr(self, expr):
36863685
return ast.Module(body=[ast.Expr(value=expr)])

0 commit comments

Comments
 (0)