Skip to content

Commit 03129de

Browse files
brandtbuchermiss-islington
authored andcommitted
pythonGH-129805: Clean up some changes from pythonGH-129806 (pythonGH-133540)
(cherry picked from commit 55e29a6) Co-authored-by: Brandt Bucher <[email protected]>
1 parent 1c90186 commit 03129de

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
@@ -114,7 +114,7 @@ def _handle_section(self, section: _S, group: _stencils.StencilGroup) -> None:
114114
raise NotImplementedError(type(self))
115115

116116
def _handle_relocation(
117-
self, base: int, relocation: _R, raw: bytes | bytearray
117+
self, base: int, relocation: _R, raw: bytearray
118118
) -> _stencils.Hole:
119119
raise NotImplementedError(type(self))
120120

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

284284
def _handle_relocation(
285-
self,
286-
base: int,
287-
relocation: _schema.COFFRelocation,
288-
raw: bytes | bytearray,
285+
self, base: int, relocation: _schema.COFFRelocation, raw: bytearray
289286
) -> _stencils.Hole:
290287
match relocation:
291288
case {
@@ -380,10 +377,7 @@ def _handle_section(
380377
}, section_type
381378

382379
def _handle_relocation(
383-
self,
384-
base: int,
385-
relocation: _schema.ELFRelocation,
386-
raw: bytes | bytearray,
380+
self, base: int, relocation: _schema.ELFRelocation, raw: bytearray
387381
) -> _stencils.Hole:
388382
symbol: str | None
389383
match relocation:
@@ -459,10 +453,7 @@ def _handle_section(
459453
stencil.holes.append(hole)
460454

461455
def _handle_relocation(
462-
self,
463-
base: int,
464-
relocation: _schema.MachORelocation,
465-
raw: bytes | bytearray,
456+
self, base: int, relocation: _schema.MachORelocation, raw: bytearray
466457
) -> _stencils.Hole:
467458
symbol: str | None
468459
match relocation:

0 commit comments

Comments
 (0)