mirror of https://github.com/python/cpython
Sigh. Strengthen the resriction of the previous checkin: tp_new is
inherited unless *both*: (a) the base type is 'object', and (b) the subtype is not a "heap" type.
This commit is contained in:
parent
c11e192d41
commit
29687cd211
|
@ -1152,7 +1152,8 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
|
|||
COPYSLOT(tp_dictoffset);
|
||||
COPYSLOT(tp_init);
|
||||
COPYSLOT(tp_alloc);
|
||||
if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) {
|
||||
if (base != &PyBaseObject_Type ||
|
||||
(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) {
|
||||
COPYSLOT(tp_new);
|
||||
}
|
||||
COPYSLOT(tp_free);
|
||||
|
|
Loading…
Reference in New Issue