Skip to content

Commit 55e29a6

Browse files
authored
GH-129805: Clean up some changes from GH-129806 (GH-133540)
1 parent fc3e22a commit 55e29a6

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
@@ -137,11 +137,7 @@ class Hole:
137137
def __post_init__(self) -> None:
138138
self.func = _PATCH_FUNCS[self.kind]
139139

140-
def fold(
141-
self,
142-
other: typing.Self,
143-
body: bytes | bytearray,
144-
) -> typing.Self | None:
140+
def fold(self, other: typing.Self, body: bytearray) -> typing.Self | None:
145141
"""Combine two holes into a single hole, if possible."""
146142
instruction_a = int.from_bytes(
147143
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
@@ -119,7 +119,7 @@ def _handle_section(self, section: _S, group: _stencils.StencilGroup) -> None:
119119
raise NotImplementedError(type(self))
120120

121121
def _handle_relocation(
122-
self, base: int, relocation: _R, raw: bytes | bytearray
122+
self, base: int, relocation: _R, raw: bytearray
123123
) -> _stencils.Hole:
124124
raise NotImplementedError(type(self))
125125

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

299299
def _handle_relocation(
300-
self,
301-
base: int,
302-
relocation: _schema.COFFRelocation,
303-
raw: bytes | bytearray,
300+
self, base: int, relocation: _schema.COFFRelocation, raw: bytearray
304301
) -> _stencils.Hole:
305302
match relocation:
306303
case {
@@ -410,10 +407,7 @@ def _handle_section(
410407
}, section_type
411408

412409
def _handle_relocation(
413-
self,
414-
base: int,
415-
relocation: _schema.ELFRelocation,
416-
raw: bytes | bytearray,
410+
self, base: int, relocation: _schema.ELFRelocation, raw: bytearray
417411
) -> _stencils.Hole:
418412
symbol: str | None
419413
match relocation:
@@ -492,10 +486,7 @@ def _handle_section(
492486
stencil.holes.append(hole)
493487

494488
def _handle_relocation(
495-
self,
496-
base: int,
497-
relocation: _schema.MachORelocation,
498-
raw: bytes | bytearray,
489+
self, base: int, relocation: _schema.MachORelocation, raw: bytearray
499490
) -> _stencils.Hole:
500491
symbol: str | None
501492
match relocation:

0 commit comments

Comments
 (0)