[Python-checkins] python/dist/src/Objects typeobject.c,2.176,2.177
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Wed, 14 Aug 2002 10:26:33 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv17052
Modified Files:
typeobject.c
Log Message:
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.176
retrieving revision 2.177
diff -C2 -d -r2.176 -r2.177
*** typeobject.c 13 Aug 2002 22:19:12 -0000 2.176
--- typeobject.c 14 Aug 2002 17:26:30 -0000 2.177
***************
*** 2295,2298 ****
--- 2295,2304 ----
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
***************
*** 2311,2320 ****
goto error;
type->tp_bases = bases;
- }
-
- /* Initialize the base class */
- if (base && base->tp_dict == NULL) {
- if (PyType_Ready(base) < 0)
- goto error;
}
--- 2317,2320 ----