]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-129805: Fix `bytes` annotation in `Tools/jit` (GH-129806) (#130216)
authorsobolevn <mail@sobolevn.me>
Mon, 17 Feb 2025 08:21:47 +0000 (11:21 +0300)
committerGitHub <noreply@github.com>
Mon, 17 Feb 2025 08:21:47 +0000 (08:21 +0000)
(cherry picked from commit 422f8e9e02e68d45aee3846751a003a70fca13b6)

Tools/jit/_targets.py

index 73d10a128756eb1cb52fead6a528d1ef91d835e8..cebfad5a7467d24e40d5ce6925e2efc4d13cd5a1 100644 (file)
@@ -102,7 +102,7 @@ class _Target(typing.Generic[_S, _R]):
         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))
 
@@ -275,7 +275,10 @@ class _COFF(
         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 {
@@ -366,7 +369,10 @@ class _ELF(
             }, 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:
@@ -442,7 +448,10 @@ class _MachO(
             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: