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

Guido van Rossum gvanrossum@users.sourceforge.net
Sat, 12 May 2001 13:41:32 -0700


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

Modified Files:
      Tag: descr-branch
	typeobject.c 
Log Message:
Add a test to prevent subtyping of types w/o a valid tp_construct
slot.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.16.8.19
retrieving revision 2.16.8.20
diff -C2 -r2.16.8.19 -r2.16.8.20
*** typeobject.c	2001/05/11 21:51:35	2.16.8.19
--- typeobject.c	2001/05/12 20:41:30	2.16.8.20
***************
*** 177,180 ****
--- 177,185 ----
  		return NULL;
  	}
+ 	if (base->tp_construct == NULL) {
+ 		PyErr_SetString(PyExc_TypeError,
+ 				"base type must have a constructor slot");
+ 		return NULL;
+ 	}
  
  	/* Check for a __slots__ sequence variable in dict, and count it */