Skip to content

Commit 075acec

Browse files
committed
Clean up some changes from GH-129806
1 parent b1aa515 commit 075acec

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

Tools/jit/_stencils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,7 @@ class Hole:
140140
def __post_init__(self) -> None:
141141
self.func = _PATCH_FUNCS[self.kind]
142142

143-
def fold(
144-
self,
145-
other: typing.Self,
146-
body: bytes | bytearray,
147-
) -> typing.Self | None:
143+
def fold(self, other: typing.Self, body: bytearray) -> typing.Self | None:
148144
"""Combine two holes into a single hole, if possible."""
149145
instruction_a = int.from_bytes(
150146
body[self.offset : self.offset + 4], byteorder=sys.byteorder

Tools/jit/_targets.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _handle_section(self, section: _S, group: _stencils.StencilGroup) -> None:
110110
raise NotImplementedError(type(self))
111111

112112
def _handle_relocation(
113-
self, base: int, relocation: _R, raw: bytes | bytearray
113+
self, base: int, relocation: _R, raw: bytearray
114114
) -> _stencils.Hole:
115115
raise NotImplementedError(type(self))
116116

@@ -277,10 +277,7 @@ def _unwrap_dllimport(self, name: str) -> tuple[_stencils.HoleValue, str | None]
277277
return _stencils.symbol_to_value(name)
278278

279279
def _handle_relocation(
280-
self,
281-
base: int,
282-
relocation: _schema.COFFRelocation,
283-
raw: bytes | bytearray,
280+
self, base: int, relocation: _schema.COFFRelocation, raw: bytearray
284281
) -> _stencils.Hole:
285282
match relocation:
286283
case {
@@ -375,10 +372,7 @@ def _handle_section(
375372
}, section_type
376373

377374
def _handle_relocation(
378-
self,
379-
base: int,
380-
relocation: _schema.ELFRelocation,
381-
raw: bytes | bytearray,
375+
self, base: int, relocation: _schema.ELFRelocation, raw: bytearray
382376
) -> _stencils.Hole:
383377
symbol: str | None
384378
match relocation:
@@ -454,10 +448,7 @@ def _handle_section(
454448
stencil.holes.append(hole)
455449

456450
def _handle_relocation(
457-
self,
458-
base: int,
459-
relocation: _schema.MachORelocation,
460-
raw: bytes | bytearray,
451+
self, base: int, relocation: _schema.MachORelocation, raw: bytearray
461452
) -> _stencils.Hole:
462453
symbol: str | None
463454
match relocation:

0 commit comments

Comments
 (0)