=== modified file 'Objects/typeobject.c' --- Objects/typeobject.c 2008-06-24 22:46:07 +0000 +++ Objects/typeobject.c 2008-07-03 02:16:07 +0000 @@ -3550,8 +3550,6 @@ static void inherit_special(PyTypeObject *type, PyTypeObject *base) { - Py_ssize_t oldsize, newsize; - /* Special flag magic */ if (!type->tp_as_buffer && base->tp_as_buffer) { type->tp_flags &= ~Py_TPFLAGS_HAVE_GETCHARBUFFER; @@ -3579,9 +3577,6 @@ type->tp_flags |= base->tp_flags & Py_TPFLAGS_CHECKTYPES; } - /* 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_flags & Py_TPFLAGS_HAVE_RICHCOMPARE/*GC slots exist*/) && @@ -3609,7 +3604,9 @@ 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 */