gh-119311: Fix name mangling with PEP 695 generic classes (#119464)

Fixes #119311. Fixes #119395.
This commit is contained in:
Jelle Zijlstra 2024-05-27 19:50:38 -07:00 committed by GitHub
parent 3e8b60905e
commit a9a74da4a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 150 additions and 14 deletions

View file

@ -473,6 +473,7 @@ _code_type = type(_write_atomic.__code__)
# Python 3.13a5 3569 (Specialize CONTAINS_OP)
# Python 3.13a6 3570 (Add __firstlineno__ class attribute)
# Python 3.14a1 3600 (Add LOAD_COMMON_CONSTANT)
# Python 3.14a1 3601 (Fix miscompilation of private names in generic classes)
# Python 3.15 will start with 3700
@ -489,7 +490,7 @@ _code_type = type(_write_atomic.__code__)
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.
MAGIC_NUMBER = (3600).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3601).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c