Inexplicably, recurse_down_subclasses() was comparing the object

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.
This commit is contained in:
Guido van Rossum 2002-06-14 02:27:07 +00:00
parent 2c2e827029
commit 59e6c53920
1 changed files with 2 additions and 1 deletions

View 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 */