[Python-checkins] python/dist/src/Tools/bgen/bgen bgenObjectDefinition.py,1.21,1.22
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
Thu, 19 Dec 2002 12:37:35 -0800
Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen
In directory sc8-pr-cvs1:/tmp/cvs-serv29622
Modified Files:
bgenObjectDefinition.py
Log Message:
Always output an inheritance-aware version of the xxxx_Check() macro. Also
fixed that macro to actually work:-)
Index: bgenObjectDefinition.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenObjectDefinition.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** bgenObjectDefinition.py 5 Dec 2002 23:20:12 -0000 1.21
--- bgenObjectDefinition.py 19 Dec 2002 20:37:32 -0000 1.22
***************
*** 48,57 ****
Output("%sPyTypeObject %s;", sf, self.typename)
Output()
! if self.basetype:
! Output("#define %s_Check(x) ((x)->ob_type == &%s || PyObject_TypeCheck((x), %s)",
self.prefix, self.typename, self.typename)
- else:
- Output("#define %s_Check(x) ((x)->ob_type == &%s)",
- self.prefix, self.typename)
Output()
Output("typedef struct %s {", self.objecttype)
--- 48,53 ----
Output("%sPyTypeObject %s;", sf, self.typename)
Output()
! Output("#define %s_Check(x) ((x)->ob_type == &%s || PyObject_TypeCheck((x), &%s))",
self.prefix, self.typename, self.typename)
Output()
Output("typedef struct %s {", self.objecttype)