Always output an inheritance-aware version of the xxxx_Check() macro. Also

fixed that macro to actually work:-)
This commit is contained in:
Jack Jansen 2002-12-19 20:37:32 +00:00
parent 03d00d51ba
commit 5bb2f6497f
1 changed files with 1 additions and 5 deletions

View File

@ -47,12 +47,8 @@ class ObjectDefinition(GeneratorGroup):
sf = self.static and "static " sf = self.static and "static "
Output("%sPyTypeObject %s;", sf, self.typename) Output("%sPyTypeObject %s;", sf, self.typename)
Output() Output()
if self.basetype: Output("#define %s_Check(x) ((x)->ob_type == &%s || PyObject_TypeCheck((x), &%s))",
Output("#define %s_Check(x) ((x)->ob_type == &%s || PyObject_TypeCheck((x), %s)",
self.prefix, self.typename, self.typename) self.prefix, self.typename, self.typename)
else:
Output("#define %s_Check(x) ((x)->ob_type == &%s)",
self.prefix, self.typename)
Output() Output()
Output("typedef struct %s {", self.objecttype) Output("typedef struct %s {", self.objecttype)
IndentLevel() IndentLevel()