]> granicus.if.org Git - python/commitdiff
Inexplicably, recurse_down_subclasses() was comparing the object
authorGuido van Rossum <guido@python.org>
Fri, 14 Jun 2002 02:27:07 +0000 (02:27 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 14 Jun 2002 02:27:07 +0000 (02:27 +0000)
gotten from a weak reference to NULL instead of to None.  This caused
the following assert() to fail (but only in 2.2 in the debug build --
I have to find a better test case).  Will backport.

Objects/typeobject.c

index b9890eaf4512aae5058786ff067e51873eea6c9e..0051179c2f615e0ea9fcb6c021cbaf8c9a6be185 100644 (file)
@@ -4029,7 +4029,8 @@ recurse_down_subclasses(PyTypeObject *type, slotdef **pp, PyObject *name)
                ref = PyList_GET_ITEM(subclasses, i);
                assert(PyWeakref_CheckRef(ref));
                subclass = (PyTypeObject *)PyWeakref_GET_OBJECT(ref);
-               if (subclass == NULL)
+               assert(subclass != NULL);
+               if ((PyObject *)subclass == Py_None)
                        continue;
                assert(PyType_Check(subclass));
                /* Avoid recursing down into unaffected classes */