diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-07-05 15:01:22 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-07-05 15:01:22 (GMT) |
commit | a7465e2fdf7f7effe19fbbe2c9a79a40df6c5d9f (patch) | |
tree | b2eef1014854a007cb4d59478661e4f4702ea916 /Objects | |
parent | 335d2c757d04f68c6711454aec5cbb07f36fcea2 (diff) | |
download | cpython-a7465e2fdf7f7effe19fbbe2c9a79a40df6c5d9f.zip cpython-a7465e2fdf7f7effe19fbbe2c9a79a40df6c5d9f.tar.gz cpython-a7465e2fdf7f7effe19fbbe2c9a79a40df6c5d9f.tar.bz2 |
cleanup basicsize logic #3268
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 2d9d031..268a924 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3476,11 +3476,8 @@ add_getset(PyTypeObject *type, PyGetSetDef *gsp) static void inherit_special(PyTypeObject *type, PyTypeObject *base) { - Py_ssize_t oldsize, newsize; /* Copying basicsize is connected to the GC flags */ - oldsize = base->tp_basicsize; - newsize = type->tp_basicsize ? type->tp_basicsize : oldsize; if (!(type->tp_flags & Py_TPFLAGS_HAVE_GC) && (base->tp_flags & Py_TPFLAGS_HAVE_GC) && (!type->tp_traverse && !type->tp_clear)) { @@ -3507,7 +3504,8 @@ inherit_special(PyTypeObject *type, PyTypeObject *base) type->tp_new = base->tp_new; } } - type->tp_basicsize = newsize; + if (type->tp_basicsize == 0) + type->tp_basicsize = base->tp_basicsize; /* Copy other non-function slots */ |