Skip to content

Commit 2492b40

Browse files
author
rocky
committed
Newset Rust uses 3.12 interim magic number!
1 parent 6d2b082 commit 2492b40

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

xdis/magics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
12897, # RustPython 3.12.0 0.4.0
5454
13413, # RustPython 3.13
5555
24881, # RustPython 3.13 0.4.0
56+
3531, # RustPython 3.13 0.4.0 later version!
5657
)
5758

5859
# A list of interim Python version magic numbers used, but were not
@@ -516,7 +517,7 @@ def __by_version(magic_versions: Dict[bytes, str]) -> dict:
516517
add_magic_from_int(3512, "3.12a2c")
517518
add_magic_from_int(3513, "3.12a4a")
518519
add_magic_from_int(3514, "3.12a4b")
519-
add_magic_from_int(3515, "3.12a5a")
520+
# add_magic_from_int(3515, "3.12a5a") # Rust Python 3.13 0.40 uses this too!
520521
add_magic_from_int(3516, "3.12a5b")
521522
add_magic_from_int(3517, "3.12a5c")
522523
add_magic_from_int(3518, "3.12a6a")

xdis/unmarsh_rust.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def t_code_rust(self, save_ref, bytes_for_s: bool = False) -> Code313Rust:
199199
obj_name_len = self.read_int32()
200200
obj_name = self.read_string(obj_name_len, False)
201201

202-
if self.magic_int in (24881,):
202+
if self.magic_int in (24881, 3531):
203203
qualname_len = self.read_int32()
204204
co_qualname = self.read_string(qualname_len, False)
205205

@@ -235,7 +235,7 @@ def read_names():
235235
co_freevars = read_names()
236236
co_nlocals = 0
237237

238-
if self.magic_int in (24881,):
238+
if self.magic_int in (24881, 3531):
239239
linetable_len = self.read_int32()
240240
co_linetable = self.read_slice(linetable_len)
241241

0 commit comments

Comments
 (0)