Lint: Use Ruff to format ``Tools/jit`` by AA-Turner · Pull Request #133123 · python/cpython · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Format with newer Ruff
  • Loading branch information
hugovk committed Apr 29, 2026
commit 8360e0fa2a1694de5a23644462f71a6caba30bd8
3 changes: 2 additions & 1 deletion Tools/jit/_llvm.py
7 changes: 3 additions & 4 deletions Tools/jit/_optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@

@enum.unique
class InstructionKind(enum.Enum):

JUMP = enum.auto()
LONG_BRANCH = enum.auto()
SHORT_BRANCH = enum.auto()
Expand Down Expand Up @@ -534,9 +533,9 @@ def _validate(self) -> None:
continue
for inst in block.instructions:
if self.frame_pointers:
assert (
self._frame_pointer_modify.match(inst.text) is None
), "Frame pointer should not be modified"
assert self._frame_pointer_modify.match(inst.text) is None, (
"Frame pointer should not be modified"
)

def run(self) -> None:
"""Run this optimizer."""
Expand Down
12 changes: 3 additions & 9 deletions Tools/jit/_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,7 @@ def build(
jit_stencils_new.unlink(missing_ok=True)


class _COFF(
_Target[_schema.COFFSection, _schema.COFFRelocation]
): # pylint: disable = too-few-public-methods
class _COFF(_Target[_schema.COFFSection, _schema.COFFRelocation]): # pylint: disable = too-few-public-methods
def _shim_compile_args(self) -> list[str]:
# The linked shim is part of pythoncore, not a shared extension.
# On Windows, Py_BUILD_CORE_MODULE makes public APIs import from
Expand Down Expand Up @@ -443,9 +441,7 @@ def _compile_args(self) -> list[str]:
return [runtime, *self.args]


class _ELF(
_Target[_schema.ELFSection, _schema.ELFRelocation]
): # pylint: disable = too-few-public-methods
class _ELF(_Target[_schema.ELFSection, _schema.ELFRelocation]): # pylint: disable = too-few-public-methods
label_prefix = ".L"
symbol_prefix = ""
re_global = re.compile(r'\s*\.globl\s+(?P<label>[\w."$?@]+)(\s+.*)?')
Expand Down Expand Up @@ -534,9 +530,7 @@ def _handle_relocation(
return _stencils.Hole(offset, kind, value, symbol, addend)


class _MachO(
_Target[_schema.MachOSection, _schema.MachORelocation]
): # pylint: disable = too-few-public-methods
class _MachO(_Target[_schema.MachOSection, _schema.MachORelocation]): # pylint: disable = too-few-public-methods
label_prefix = "L"
symbol_prefix = "_"
re_global = re.compile(r'\s*\.globl\s+(?P<label>[\w."$?@]+)(\s+.*)?')
Expand Down
2 changes: 1 addition & 1 deletion Tools/jit/example_trace_dump.py
Loading