[3.13] gh-117482: Fix the Slot Wrapper Inheritance Tests (gh-122249)

The tests were only checking cases where the slot wrapper was present in the initial case.  They were missing when the slot wrapper was added in the additional initializations.  This fixes that.

(cherry-picked from commit 490e0ad83a, AKA gh-122248)
This commit is contained in:
Eric Snow 2024-07-29 10:25:02 -06:00 committed by GitHub
parent b5e8b10de7
commit 10cf7d6d00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 131 additions and 51 deletions

View file

@ -10879,7 +10879,25 @@ expect_manually_inherited(PyTypeObject *type, void **slot)
&& typeobj != PyExc_StopIteration
&& typeobj != PyExc_SyntaxError
&& typeobj != PyExc_UnicodeDecodeError
&& typeobj != PyExc_UnicodeEncodeError)
&& typeobj != PyExc_UnicodeEncodeError
&& type != &PyBool_Type
&& type != &PyBytes_Type
&& type != &PyMemoryView_Type
&& type != &PyComplex_Type
&& type != &PyEnum_Type
&& type != &PyFilter_Type
&& type != &PyFloat_Type
&& type != &PyFrozenSet_Type
&& type != &PyLong_Type
&& type != &PyMap_Type
&& type != &PyRange_Type
&& type != &PyReversed_Type
&& type != &PySlice_Type
&& type != &PyTuple_Type
&& type != &PyUnicode_Type
&& type != &PyZip_Type)
{
return 1;
}
@ -10897,10 +10915,8 @@ expect_manually_inherited(PyTypeObject *type, void **slot)
/* This is a best-effort list of builtin types
that have their own tp_getattr function. */
if (typeobj == PyExc_BaseException
|| type == &PyBool_Type
|| type == &PyByteArray_Type
|| type == &PyBytes_Type
|| type == &PyClassMethod_Type
|| type == &PyComplex_Type
|| type == &PyDict_Type
|| type == &PyEnum_Type
@ -10914,7 +10930,6 @@ expect_manually_inherited(PyTypeObject *type, void **slot)
|| type == &PyReversed_Type
|| type == &PySet_Type
|| type == &PySlice_Type
|| type == &PyStaticMethod_Type
|| type == &PySuper_Type
|| type == &PyTuple_Type
|| type == &PyZip_Type)