Commit 1229cea9 authored by Jack Jansen's avatar Jack Jansen

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

fixed that macro to actually work:-)
parent 348ca948
......@@ -47,12 +47,8 @@ class ObjectDefinition(GeneratorGroup):
sf = self.static and "static "
Output("%sPyTypeObject %s;", sf, self.typename)
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)
else:
Output("#define %s_Check(x) ((x)->ob_type == &%s)",
self.prefix, self.typename)
Output()
Output("typedef struct %s {", self.objecttype)
IndentLevel()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment