Always output an inheritance-aware version of the xxxx_Check() macro. Also
fixed that macro to actually work:-)
diff --git a/Tools/bgen/bgen/bgenObjectDefinition.py b/Tools/bgen/bgen/bgenObjectDefinition.py
index c409260..510b9b8 100644
--- a/Tools/bgen/bgen/bgenObjectDefinition.py
+++ b/Tools/bgen/bgen/bgenObjectDefinition.py
@@ -47,12 +47,8 @@
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()