summaryrefslogtreecommitdiffstats
path: root/Tools/peg_generator
diff options
context:
space:
mode:
authorAnthony Shaw <anthony.p.shaw@gmail.com>2020-05-04 02:03:05 (GMT)
committerGitHub <noreply@github.com>2020-05-04 02:03:05 (GMT)
commitc95e691c904bb5ebd91825efa81b93cb9e354a85 (patch)
treec4d647f2d31e135568b3ea7295b32e4d79607ed0 /Tools/peg_generator
parent7f06af684a1882fdb19d20650825948b1d7996e5 (diff)
downloadcpython-c95e691c904bb5ebd91825efa81b93cb9e354a85.zip
cpython-c95e691c904bb5ebd91825efa81b93cb9e354a85.tar.gz
cpython-c95e691c904bb5ebd91825efa81b93cb9e354a85.tar.bz2
Clean up unused imports for the peg generator module (GH-19891)
Diffstat (limited to 'Tools/peg_generator')
-rw-r--r--Tools/peg_generator/pegen/build.py3
-rw-r--r--Tools/peg_generator/pegen/c_generator.py2
-rwxr-xr-xTools/peg_generator/pegen/first_sets.py3
-rw-r--r--Tools/peg_generator/pegen/grammar.py3
-rw-r--r--Tools/peg_generator/pegen/grammar_visualizer.py2
-rw-r--r--Tools/peg_generator/scripts/ast_timings.py2
-rw-r--r--Tools/peg_generator/scripts/benchmark.py1
-rwxr-xr-xTools/peg_generator/scripts/find_max_nesting.py4
-rwxr-xr-xTools/peg_generator/scripts/test_parse_directory.py1
9 files changed, 4 insertions, 17 deletions
diff --git a/Tools/peg_generator/pegen/build.py b/Tools/peg_generator/pegen/build.py
index 8f9348d..931ffc7 100644
--- a/Tools/peg_generator/pegen/build.py
+++ b/Tools/peg_generator/pegen/build.py
@@ -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
diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py
index c9c6706..40004e7 100644
--- a/Tools/peg_generator/pegen/c_generator.py
+++ b/Tools/peg_generator/pegen/c_generator.py
@@ -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
diff --git a/Tools/peg_generator/pegen/first_sets.py b/Tools/peg_generator/pegen/first_sets.py
index da30eba..71be5a2 100755
--- a/Tools/peg_generator/pegen/first_sets.py
+++ b/Tools/peg_generator/pegen/first_sets.py
@@ -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 (
diff --git a/Tools/peg_generator/pegen/grammar.py b/Tools/peg_generator/pegen/grammar.py
index 67039d5..78edf41 100644
--- a/Tools/peg_generator/pegen/grammar.py
+++ b/Tools/peg_generator/pegen/grammar.py
@@ -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
diff --git a/Tools/peg_generator/pegen/grammar_visualizer.py b/Tools/peg_generator/pegen/grammar_visualizer.py
index b1d51d2..7362ec5 100644
--- a/Tools/peg_generator/pegen/grammar_visualizer.py
+++ b/Tools/peg_generator/pegen/grammar_visualizer.py
@@ -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
diff --git a/Tools/peg_generator/scripts/ast_timings.py b/Tools/peg_generator/scripts/ast_timings.py
index 7ebd46f..ca25220 100644
--- a/Tools/peg_generator/scripts/ast_timings.py
+++ b/Tools/peg_generator/scripts/ast_timings.py
@@ -1,8 +1,6 @@
import ast
import sys
import time
-import token
-import tokenize
from pegen.testutil import print_memstats
diff --git a/Tools/peg_generator/scripts/benchmark.py b/Tools/peg_generator/scripts/benchmark.py
index 0e9d5bd..d39ac3d 100644
--- a/Tools/peg_generator/scripts/benchmark.py
+++ b/Tools/peg_generator/scripts/benchmark.py
@@ -4,7 +4,6 @@ import argparse
import ast
import sys
import os
-import resource
from time import time
import memory_profiler
diff --git a/Tools/peg_generator/scripts/find_max_nesting.py b/Tools/peg_generator/scripts/find_max_nesting.py
index a2c41a8..f2fdd00 100755
--- a/Tools/peg_generator/scripts/find_max_nesting.py
+++ b/Tools/peg_generator/scripts/find_max_nesting.py
@@ -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
diff --git a/Tools/peg_generator/scripts/test_parse_directory.py b/Tools/peg_generator/scripts/test_parse_directory.py
index a6078ef..aef9c74 100755
--- a/Tools/peg_generator/scripts/test_parse_directory.py
+++ b/Tools/peg_generator/scripts/test_parse_directory.py
@@ -4,7 +4,6 @@ import argparse
import ast
import os
import sys
-import tempfile
import time
import traceback
from glob import glob