[Python-checkins] CVS: python/dist/src/Modules xxsubtype.c,2.10,2.11

Guido van Rossum gvanrossum@users.sourceforge.net
Mon, 17 Dec 2001 09:25:55 -0800


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

Modified Files:
	xxsubtype.c 
Log Message:
Use PyType_Ready() for initialization of the ob_type field of our
types (the tp_base field must be initialized prior to that call).


Index: xxsubtype.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/xxsubtype.c,v
retrieving revision 2.10
retrieving revision 2.11
diff -C2 -d -r2.10 -r2.11
*** xxsubtype.c	2001/12/17 01:27:01	2.10
--- xxsubtype.c	2001/12/17 17:25:53	2.11
***************
*** 243,251 ****
  	/* Fill in the deferred data addresses.  This must be done before
  	   PyType_Ready() is called. */
- 	spamdict_type.ob_type = &PyType_Type;
  	spamdict_type.tp_base = &PyDict_Type;
  
- 	spamlist_type.ob_type = &PyType_Type;
  	spamlist_type.tp_base = &PyList_Type;
  
  	m = Py_InitModule3("xxsubtype",
--- 243,253 ----
  	/* Fill in the deferred data addresses.  This must be done before
  	   PyType_Ready() is called. */
  	spamdict_type.tp_base = &PyDict_Type;
+ 	if (PyType_Ready(&spamdict_type) < 0)
+ 		return;
  
  	spamlist_type.tp_base = &PyList_Type;
+ 	if (PyType_Ready(&spamlist_type) < 0)
+ 		return;
  
  	m = Py_InitModule3("xxsubtype",