]> granicus.if.org Git - python/commitdiff
Undo the last chunk of the previous patch, putting back a useful
authorGuido van Rossum <guido@python.org>
Mon, 10 Jun 2002 15:29:03 +0000 (15:29 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 10 Jun 2002 15:29:03 +0000 (15:29 +0000)
assert into PyType_Ready(): now that we're not clearing tp_dict, we
can assert that it's non-NULL again.

Objects/typeobject.c

index 8b51a53fb4849fc9733ed07d1a799f1b1c40afbc..49c7d5250fac10a647107fe8a04f71c0dcf4bf84 100644 (file)
@@ -2175,8 +2175,10 @@ PyType_Ready(PyTypeObject *type)
        PyTypeObject *base;
        int i, n;
 
-       if (type->tp_flags & Py_TPFLAGS_READY)
+       if (type->tp_flags & Py_TPFLAGS_READY) {
+               assert(type->tp_dict != NULL);
                return 0;
+       }
        assert((type->tp_flags & Py_TPFLAGS_READYING) == 0);
 
        type->tp_flags |= Py_TPFLAGS_READYING;