Skip to content

Commit

Permalink
[3.13] gh-129805: Fix bytes annotation in Tools/jit (GH-129806) (#…
Browse files Browse the repository at this point in the history
…130216)

(cherry picked from commit 422f8e9)
  • Loading branch information
sobolevn authored Feb 17, 2025
1 parent 831695b commit 4d941d3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Tools/jit/_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _handle_section(self, section: _S, group: _stencils.StencilGroup) -> None:
raise NotImplementedError(type(self))

def _handle_relocation(
self, base: int, relocation: _R, raw: bytes
self, base: int, relocation: _R, raw: bytes | bytearray
) -> _stencils.Hole:
raise NotImplementedError(type(self))

Expand Down Expand Up @@ -275,7 +275,10 @@ def _unwrap_dllimport(self, name: str) -> tuple[_stencils.HoleValue, str | None]
return _stencils.symbol_to_value(name)

def _handle_relocation(
self, base: int, relocation: _schema.COFFRelocation, raw: bytes
self,
base: int,
relocation: _schema.COFFRelocation,
raw: bytes | bytearray,
) -> _stencils.Hole:
match relocation:
case {
Expand Down Expand Up @@ -366,7 +369,10 @@ def _handle_section(
}, section_type

def _handle_relocation(
self, base: int, relocation: _schema.ELFRelocation, raw: bytes
self,
base: int,
relocation: _schema.ELFRelocation,
raw: bytes | bytearray,
) -> _stencils.Hole:
symbol: str | None
match relocation:
Expand Down Expand Up @@ -442,7 +448,10 @@ def _handle_section(
stencil.holes.append(hole)

def _handle_relocation(
self, base: int, relocation: _schema.MachORelocation, raw: bytes
self,
base: int,
relocation: _schema.MachORelocation,
raw: bytes | bytearray,
) -> _stencils.Hole:
symbol: str | None
match relocation:
Expand Down

0 comments on commit 4d941d3

Please sign in to comment.