From 63b1fcba9c12996c37c435ba063b01660279323c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 14 Jun 2002 02:28:23 +0000 Subject: [PATCH] Backport: 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). --- Objects/typeobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/typeobject.c b/Objects/typeobject.c index c7a42548f90a..ca5140c17fa3 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3862,7 +3862,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 */ -- 2.47.3