[Python-checkins] python/dist/src/Objects typeobject.c,2.153,2.154

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 13 Jun 2002 19:27:09 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv567

Modified Files:
	typeobject.c 
Log Message:
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.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.153
retrieving revision 2.154
diff -C2 -d -r2.153 -r2.154
*** typeobject.c	13 Jun 2002 20:33:01 -0000	2.153
--- typeobject.c	14 Jun 2002 02:27:07 -0000	2.154
***************
*** 4030,4034 ****
  		assert(PyWeakref_CheckRef(ref));
  		subclass = (PyTypeObject *)PyWeakref_GET_OBJECT(ref);
! 		if (subclass == NULL)
  			continue;
  		assert(PyType_Check(subclass));
--- 4030,4035 ----
  		assert(PyWeakref_CheckRef(ref));
  		subclass = (PyTypeObject *)PyWeakref_GET_OBJECT(ref);
! 		assert(subclass != NULL);
! 		if ((PyObject *)subclass == Py_None)
  			continue;
  		assert(PyType_Check(subclass));