diff options
-rw-r--r-- | Objects/typeobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 7076b36..157f0c9 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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); |