summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-08-09 19:43:37 (GMT)
committerGuido van Rossum <guido@python.org>2001-08-09 19:43:37 (GMT)
commit29687cd2112c540a8a4d31cf3b191cf10db08412 (patch)
tree41b91c830a083ac78cba02117fea01bee9f07041 /Objects
parentc11e192d416e2970e6a06cf06d4cf788f322c6ea (diff)
downloadcpython-29687cd2112c540a8a4d31cf3b191cf10db08412.zip
cpython-29687cd2112c540a8a4d31cf3b191cf10db08412.tar.gz
cpython-29687cd2112c540a8a4d31cf3b191cf10db08412.tar.bz2
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.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c3
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);