]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-117482: Fix Builtin Types Slot Wrappers (gh-121630)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 11 Jul 2024 20:47:38 +0000 (22:47 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Jul 2024 20:47:38 +0000 (20:47 +0000)
commitc6dbfbbe3c24cf2dd6a589904383f28cd1a1f4db
tree098db975cd3e0baa2258708f66a3d2b6e7889dc0
parent38c4028dd9aeeeb1fe4ba1444307e3f06fc63aa0
[3.13] gh-117482: Fix Builtin Types Slot Wrappers (gh-121630)

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 5250a031332eb9499d5fc190d7287642e5a144b9, AKA gh-121602)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Include/internal/pycore_typeobject.h
Lib/test/test_types.py
Misc/NEWS.d/next/Core and Builtins/2024-07-10-15-43-54.gh-issue-117482.5WYaXR.rst [new file with mode: 0644]
Objects/typeobject.c