[3.12] gh-117482: Fix Builtin Types Slot Wrappers (gh-121632)

When builtin static types are initialized for a subinterpreter, various "tp" slots have already been inherited (for the main interpreter).  This was interfering with the logic in add_operators() (in Objects/typeobject.c), causing a wrapper to get created when it shouldn't.  This change fixes that by preserving the original data from the static type struct and checking that.

(cherry picked from commit 5250a03133, AKA gh-121602)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
Eric Snow 2024-07-11 15:20:08 -06:00 committed by GitHub
parent 5492f84c14
commit 0ec761a96a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 74 additions and 9 deletions

View file

@ -305,6 +305,11 @@ Objects/sliceobject.c - _Py_EllipsisObject -
Python/instrumentation.c - _PyInstrumentation_DISABLE -
Python/instrumentation.c - _PyInstrumentation_MISSING -
##-----------------------
## other
Objects/typeobject.c - static_type_defs -
##################################
## global non-objects to fix in core code

Can't render this file because it has a wrong number of fields in line 4.