diff options
author | Guido van Rossum <guido@python.org> | 2002-06-14 02:27:07 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-06-14 02:27:07 (GMT) |
commit | 59e6c539207346398f02820ed1d80e3245112179 (patch) | |
tree | c5ef68eff1139103c0d2808928f8ac9a90bd9e6d /Objects | |
parent | 2c2e827029b093bbc922b60aa56db1be9f3ac37e (diff) | |
download | cpython-59e6c539207346398f02820ed1d80e3245112179.zip cpython-59e6c539207346398f02820ed1d80e3245112179.tar.gz cpython-59e6c539207346398f02820ed1d80e3245112179.tar.bz2 |
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.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index b9890ea..0051179 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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 */ |