Mercurial > cpython-lru_cache-weakref
diff Objects/typeobject.c @ 23856:868cfbdca909 legacy-trunk
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.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 14 Jun 2002 02:27:07 +0000 |
| parents | ed1ba37a46b7 |
| children | 066f8938071a |
line wrap: on
line diff
--- a/Objects/typeobject.c Fri Jun 14 02:04:18 2002 +0000 +++ b/Objects/typeobject.c Fri Jun 14 02:27:07 2002 +0000 @@ -4029,7 +4029,8 @@ 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 */
