diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2024-07-11 20:20:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-11 20:20:14 (GMT) |
commit | 5250a031332eb9499d5fc190d7287642e5a144b9 (patch) | |
tree | 6a13f6ed9cbb988752398fe935aa28f2b3947df8 /Include | |
parent | 58e8cf2bb61f82df9eabd1209fe5e3d146e4c8cd (diff) | |
download | cpython-5250a031332eb9499d5fc190d7287642e5a144b9.zip cpython-5250a031332eb9499d5fc190d7287642e5a144b9.tar.gz cpython-5250a031332eb9499d5fc190d7287642e5a144b9.tar.bz2 |
gh-117482: Fix Builtin Types Slot Wrappers (gh-121602)
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.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_typeobject.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/internal/pycore_typeobject.h b/Include/internal/pycore_typeobject.h index 32bd19d..df6bfef 100644 --- a/Include/internal/pycore_typeobject.h +++ b/Include/internal/pycore_typeobject.h @@ -33,6 +33,7 @@ struct _types_runtime_state { struct { struct { PyTypeObject *type; + PyTypeObject def; int64_t interp_count; } types[_Py_MAX_MANAGED_STATIC_TYPES]; } managed_static; |