]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clean up unused imports for the peg generator module (GH-19891)
authorAnthony Shaw <anthony.p.shaw@gmail.com>
Mon, 4 May 2020 02:03:05 +0000 (12:03 +1000)
committerGitHub <noreply@github.com>
Mon, 4 May 2020 02:03:05 +0000 (03:03 +0100)
Tools/peg_generator/pegen/build.py
Tools/peg_generator/pegen/c_generator.py
Tools/peg_generator/pegen/first_sets.py
Tools/peg_generator/pegen/grammar.py
Tools/peg_generator/pegen/grammar_visualizer.py
Tools/peg_generator/scripts/ast_timings.py
Tools/peg_generator/scripts/benchmark.py
Tools/peg_generator/scripts/find_max_nesting.py
Tools/peg_generator/scripts/test_parse_directory.py

index 8f9348ddf24ace1186ff413618282c9d8547755c..931ffc787523b541287171bba667c424ca4fd340 100644 (file)
@@ -1,12 +1,11 @@
 import pathlib
 import shutil
 import tokenize
-import sys
 import sysconfig
 import tempfile
 import itertools
 
-from typing import Optional, Tuple, List, IO, Iterator, Set, Dict
+from typing import Optional, Tuple, List, IO, Set, Dict
 
 from pegen.c_generator import CParserGenerator
 from pegen.grammar import Grammar
index c9c67067d4677f864d3c8e5c21e7136c7ffaf934..40004e7875278d0f48bcf8fc7dbd787ee3334763 100644 (file)
@@ -1,7 +1,7 @@
 import ast
 from dataclasses import dataclass, field
 import re
-from typing import IO, Any, Dict, List, Optional, Set, Text, Tuple
+from typing import Any, Dict, IO, Optional, List, Text, Tuple, Set
 from enum import Enum
 
 from pegen import grammar
index da30eba99ce5a9fb187dc94c35f9076f1512c644..71be5a2e7cbf4c0501b6d2c7e3820e165768ccf1 100755 (executable)
@@ -1,10 +1,9 @@
 #!/usr/bin/env python3.8
 
 import argparse
-import collections
 import pprint
 import sys
-from typing import Optional, Set, Dict
+from typing import Set, Dict
 
 from pegen.build import build_parser
 from pegen.grammar import (
index 67039d5a032abd4603ba1873e4112287f65cece1..78edf412ea6e4739fb58c5b4635eb2326d423ccf 100644 (file)
@@ -4,7 +4,6 @@ from abc import abstractmethod
 from typing import (
     AbstractSet,
     Any,
-    Callable,
     Dict,
     Iterable,
     Iterator,
@@ -13,11 +12,9 @@ from typing import (
     Set,
     Tuple,
     TYPE_CHECKING,
-    TypeVar,
     Union,
 )
 
-from pegen.parser import memoize, Parser
 
 if TYPE_CHECKING:
     from pegen.parser_generator import ParserGenerator
index b1d51d2cdb250fbffa18d080a1287285b003100f..7362ec5fa0f4dec3b793c180fcfb0d1e69c7be44 100644 (file)
@@ -1,7 +1,7 @@
 import argparse
 import sys
 
-from typing import Any, Iterator, Iterable, Callable
+from typing import Any, Iterator, Callable
 
 from pegen.build import build_parser
 from pegen.grammar import Grammar, Rule
index 7ebd46fdac6851589c53c094c1703b4d5449102c..ca252208f283eda69eb848067628ff82cac2a084 100644 (file)
@@ -1,8 +1,6 @@
 import ast
 import sys
 import time
-import token
-import tokenize
 
 from pegen.testutil import print_memstats
 
index 0e9d5bd1048131303b30a9eebcdab6d6434de194..d39ac3dca79e7d3ebe120587e762a4ebb6225648 100644 (file)
@@ -4,7 +4,6 @@ import argparse
 import ast
 import sys
 import os
-import resource
 from time import time
 
 import memory_profiler
index a2c41a821342af1ebbe144b1227d99151f726871..f2fdd00bfb7cd21242778240065804cff130d184 100755 (executable)
@@ -13,11 +13,7 @@ INITIAL_NESTING_DEPTH, or NESTED_INCR_AMT variables.
 
 Usage: python -m scripts.find_max_nesting
 """
-import os
 import sys
-from tempfile import TemporaryDirectory
-from pathlib import Path
-from typing import Any
 
 from _peg_parser import parse_string
 
index a6078ef56406190597e34710b6489dbe66b59786..aef9c74b528813447db1fd50d1cd9ff537297e8f 100755 (executable)
@@ -4,7 +4,6 @@ import argparse
 import ast
 import os
 import sys
-import tempfile
 import time
 import traceback
 from glob import glob