[Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.22,2.126.4.23

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
2002年8月14日 10:36:29 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv22664
Modified Files:
 Tag: release22-maint
	typeobject.c 
Log Message:
Backport:
PyType_Ready(): initialize the base class a bit earlier, so that if we
copy the metatype from the base, the base actually has one!
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.126.4.22
retrieving revision 2.126.4.23
diff -C2 -d -r2.126.4.22 -r2.126.4.23
*** typeobject.c	1 Aug 2002 19:03:43 -0000	2.126.4.22
--- typeobject.c	14 Aug 2002 17:36:26 -0000	2.126.4.23
***************
*** 2115,2118 ****
--- 2115,2124 ----
 		base = type->tp_base = &PyBaseObject_Type;
 
+ 	/* Initialize the base class */
+ 	if (base && base->tp_dict == NULL) {
+ 		if (PyType_Ready(base) < 0)
+ 			goto error;
+ 	}
+ 
 	/* Initialize ob_type if NULL. This means extensions that want to be
 	 compilable separately on Windows can call PyType_Ready() instead of
***************
*** 2131,2140 ****
 			goto error;
 		type->tp_bases = bases;
- 	}
- 
- 	/* Initialize the base class */
- 	if (base && base->tp_dict == NULL) {
- 		if (PyType_Ready(base) < 0)
- 			goto error;
 	}
 
--- 2137,2140 ----

AltStyle によって変換されたページ (->オリジナル) /