[Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.61,2.62

Guido van Rossum gvanrossum@users.sourceforge.net
Fri, 14 Sep 2001 12:43:38 -0700


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

Modified Files:
	typeobject.c 
Log Message:
tp_new_wrapper(): A subtle change in the check for safe use.
Allow staticbase != type, as long as their tp_new slots are the same.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.61
retrieving revision 2.62
diff -C2 -d -r2.61 -r2.62
*** typeobject.c	2001/09/14 17:51:50	2.61
--- typeobject.c	2001/09/14 19:43:36	2.62
***************
*** 2304,2308 ****
  	while (staticbase && (staticbase->tp_flags & Py_TPFLAGS_HEAPTYPE))
  		staticbase = staticbase->tp_base;
! 	if (staticbase != type) {
  		PyErr_Format(PyExc_TypeError,
  			     "%s.__new__(%s) is not safe, use %s.__new__()",
--- 2304,2308 ----
  	while (staticbase && (staticbase->tp_flags & Py_TPFLAGS_HEAPTYPE))
  		staticbase = staticbase->tp_base;
! 	if (staticbase->tp_new != type->tp_new) {
  		PyErr_Format(PyExc_TypeError,
  			     "%s.__new__(%s) is not safe, use %s.__new__()",