Clean up unused imports for the peg generator module (GH-19891)

This commit is contained in:
Anthony Shaw 2020-05-04 12:03:05 +10:00 committed by GitHub
parent 7f06af684a
commit c95e691c90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 4 additions and 17 deletions

View file

@ -1,12 +1,11 @@
import pathlib import pathlib
import shutil import shutil
import tokenize import tokenize
import sys
import sysconfig import sysconfig
import tempfile import tempfile
import itertools 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.c_generator import CParserGenerator
from pegen.grammar import Grammar from pegen.grammar import Grammar

View file

@ -1,7 +1,7 @@
import ast import ast
from dataclasses import dataclass, field from dataclasses import dataclass, field
import re 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 enum import Enum
from pegen import grammar from pegen import grammar

View file

@ -1,10 +1,9 @@
#!/usr/bin/env python3.8 #!/usr/bin/env python3.8
import argparse import argparse
import collections
import pprint import pprint
import sys import sys
from typing import Optional, Set, Dict from typing import Set, Dict
from pegen.build import build_parser from pegen.build import build_parser
from pegen.grammar import ( from pegen.grammar import (

View file

@ -4,7 +4,6 @@ from abc import abstractmethod
from typing import ( from typing import (
AbstractSet, AbstractSet,
Any, Any,
Callable,
Dict, Dict,
Iterable, Iterable,
Iterator, Iterator,
@ -13,11 +12,9 @@ from typing import (
Set, Set,
Tuple, Tuple,
TYPE_CHECKING, TYPE_CHECKING,
TypeVar,
Union, Union,
) )
from pegen.parser import memoize, Parser
if TYPE_CHECKING: if TYPE_CHECKING:
from pegen.parser_generator import ParserGenerator from pegen.parser_generator import ParserGenerator

View file

@ -1,7 +1,7 @@
import argparse import argparse
import sys import sys
from typing import Any, Iterator, Iterable, Callable from typing import Any, Iterator, Callable
from pegen.build import build_parser from pegen.build import build_parser
from pegen.grammar import Grammar, Rule from pegen.grammar import Grammar, Rule

View file

@ -1,8 +1,6 @@
import ast import ast
import sys import sys
import time import time
import token
import tokenize
from pegen.testutil import print_memstats from pegen.testutil import print_memstats

View file

@ -4,7 +4,6 @@ import argparse
import ast import ast
import sys import sys
import os import os
import resource
from time import time from time import time
import memory_profiler import memory_profiler

View file

@ -13,11 +13,7 @@ INITIAL_NESTING_DEPTH, or NESTED_INCR_AMT variables.
Usage: python -m scripts.find_max_nesting Usage: python -m scripts.find_max_nesting
""" """
import os
import sys import sys
from tempfile import TemporaryDirectory
from pathlib import Path
from typing import Any
from _peg_parser import parse_string from _peg_parser import parse_string

View file

@ -4,7 +4,6 @@ import argparse
import ast import ast
import os import os
import sys import sys
import tempfile
import time import time
import traceback import traceback
from glob import glob from glob import glob