Skip to content

Commit 8360e0f

Browse files
committed
Format with newer Ruff
1 parent 3e5b3d3 commit 8360e0f

4 files changed

Lines changed: 9 additions & 15 deletions

File tree

Tools/jit/_llvm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def _async_cache(f: _C[_P, _R]) -> _C[_P, _R]:
2424

2525
@functools.wraps(f)
2626
async def wrapper(
27-
*args: _P.args, **kwargs: _P.kwargs # pylint: disable = no-member
27+
*args: _P.args,
28+
**kwargs: _P.kwargs, # pylint: disable = no-member
2829
) -> _R:
2930
async with lock:
3031
if args not in cache:

Tools/jit/_optimizers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191

9292
@enum.unique
9393
class InstructionKind(enum.Enum):
94-
9594
JUMP = enum.auto()
9695
LONG_BRANCH = enum.auto()
9796
SHORT_BRANCH = enum.auto()
@@ -534,9 +533,9 @@ def _validate(self) -> None:
534533
continue
535534
for inst in block.instructions:
536535
if self.frame_pointers:
537-
assert (
538-
self._frame_pointer_modify.match(inst.text) is None
539-
), "Frame pointer should not be modified"
536+
assert self._frame_pointer_modify.match(inst.text) is None, (
537+
"Frame pointer should not be modified"
538+
)
540539

541540
def run(self) -> None:
542541
"""Run this optimizer."""

Tools/jit/_targets.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,7 @@ def build(
328328
jit_stencils_new.unlink(missing_ok=True)
329329

330330

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

445443

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

536532

537-
class _MachO(
538-
_Target[_schema.MachOSection, _schema.MachORelocation]
539-
): # pylint: disable = too-few-public-methods
533+
class _MachO(_Target[_schema.MachOSection, _schema.MachORelocation]): # pylint: disable = too-few-public-methods
540534
label_prefix = "L"
541535
symbol_prefix = "_"
542536
re_global = re.compile(r'\s*\.globl\s+(?P<label>[\w."$?@]+)(\s+.*)?')

Tools/jit/example_trace_dump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def _run_and_dump(func, n, outdir):
175175

176176
def _main():
177177
if len(sys.argv) < 2 or len(sys.argv) > 3:
178-
print(f"Usage: {sys.argv[0] if sys.argv else " "} OUTDIR [loops]")
178+
print(f"Usage: {sys.argv[0] if sys.argv else ' '} OUTDIR [loops]")
179179
outdir = sys.argv[1]
180180
n = int(sys.argv[2]) if len(sys.argv) > 2 else 5000
181181
functions = [

0 commit comments

Comments
 (0)