Skip to content

Commit

Permalink
pythongh-120417: Remove unused imports in cases_generator (python#120622
Browse files Browse the repository at this point in the history
)
  • Loading branch information
vstinner authored and estyxx committed Jul 17, 2024
1 parent 5dd4ac2 commit 4cf1312
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Tools/cases_generator/analyzer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dataclasses import dataclass, field
from dataclasses import dataclass
import lexer
import parser
import re
Expand Down
4 changes: 1 addition & 3 deletions Tools/cases_generator/generators_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
from analyzer import (
Instruction,
Uop,
analyze_files,
Properties,
Skip,
)
from cwriter import CWriter
from typing import Callable, Mapping, TextIO, Iterator
from lexer import Token
from stack import StackOffset, Stack
from stack import Stack


ROOT = Path(__file__).parent.parent.parent
Expand Down
3 changes: 0 additions & 3 deletions Tools/cases_generator/opcode_id_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
"""

import argparse
import os.path
import sys

from analyzer import (
Analysis,
Instruction,
analyze_files,
)
from generators_common import (
Expand Down
4 changes: 0 additions & 4 deletions Tools/cases_generator/opcode_metadata_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@
"""

import argparse
import os.path
import sys

from analyzer import (
Analysis,
Instruction,
PseudoInstruction,
analyze_files,
Skip,
Uop,
)
from generators_common import (
DEFAULT_INPUT,
ROOT,
write_header,
cflags,
StackOffset,
)
from cwriter import CWriter
from typing import TextIO
Expand Down
3 changes: 1 addition & 2 deletions Tools/cases_generator/optimizer_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
ROOT,
write_header,
emit_tokens,
emit_to,
replace_sync_sp,
)
from cwriter import CWriter
from typing import TextIO, Iterator
from lexer import Token
from stack import Stack, SizeMismatch, UNUSED
from stack import Stack, SizeMismatch

DEFAULT_OUTPUT = ROOT / "Python/optimizer_cases.c.h"
DEFAULT_ABSTRACT_INPUT = (ROOT / "Python/optimizer_bytecodes.c").absolute().as_posix()
Expand Down
2 changes: 1 addition & 1 deletion Tools/cases_generator/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from parsing import (
from parsing import ( # noqa: F401
InstDef,
Macro,
Pseudo,
Expand Down
1 change: 0 additions & 1 deletion Tools/cases_generator/py_metadata_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from generators_common import (
DEFAULT_INPUT,
ROOT,
root_relative_path,
write_header,
)
from cwriter import CWriter
Expand Down
1 change: 0 additions & 1 deletion Tools/cases_generator/target_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
ROOT,
)
from cwriter import CWriter
from typing import TextIO


DEFAULT_OUTPUT = ROOT / "Python/opcode_targets.h"
Expand Down
8 changes: 2 additions & 6 deletions Tools/cases_generator/tier1_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"""

import argparse
import os.path
import sys

from analyzer import (
Analysis,
Expand All @@ -14,7 +12,6 @@
Part,
analyze_files,
Skip,
StackItem,
analysis_error,
)
from generators_common import (
Expand All @@ -24,9 +21,8 @@
emit_tokens,
)
from cwriter import CWriter
from typing import TextIO, Iterator
from lexer import Token
from stack import StackOffset, Stack, SizeMismatch
from typing import TextIO
from stack import Stack, SizeMismatch


DEFAULT_OUTPUT = ROOT / "Python/generated_cases.c.h"
Expand Down
6 changes: 1 addition & 5 deletions Tools/cases_generator/tier2_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
"""

import argparse
import os.path
import sys

from analyzer import (
Analysis,
Instruction,
Uop,
Part,
analyze_files,
Skip,
StackItem,
analysis_error,
)
Expand All @@ -28,7 +24,7 @@
from cwriter import CWriter
from typing import TextIO, Iterator
from lexer import Token
from stack import StackOffset, Stack, SizeMismatch
from stack import Stack, SizeMismatch

DEFAULT_OUTPUT = ROOT / "Python/executor_cases.c.h"

Expand Down
3 changes: 0 additions & 3 deletions Tools/cases_generator/uop_id_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
"""

import argparse
import os.path
import sys

from analyzer import (
Analysis,
Instruction,
analyze_files,
)
from generators_common import (
Expand Down

0 comments on commit 4cf1312

Please sign in to comment.