[Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.15,2.126.4.16

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 13 Jun 2002 19:28:29 -0700


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

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


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.126.4.15
retrieving revision 2.126.4.16
diff -C2 -d -r2.126.4.15 -r2.126.4.16
*** typeobject.c	10 Jun 2002 16:02:44 -0000	2.126.4.15
--- typeobject.c	14 Jun 2002 02:28:23 -0000	2.126.4.16
***************
*** 3863,3867 ****
  		assert(PyWeakref_CheckRef(ref));
  		subclass = (PyTypeObject *)PyWeakref_GET_OBJECT(ref);
! 		if (subclass == NULL)
  			continue;
  		assert(PyType_Check(subclass));
--- 3863,3868 ----
  		assert(PyWeakref_CheckRef(ref));
  		subclass = (PyTypeObject *)PyWeakref_GET_OBJECT(ref);
! 		assert(subclass != NULL);
! 		if ((PyObject *)subclass == Py_None)
  			continue;
  		assert(PyType_Check(subclass));