From 5bb2f6497f6b4455e4da64ef049bf43cd1c2215a Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 19 Dec 2002 20:37:32 +0000 Subject: Always output an inheritance-aware version of the xxxx_Check() macro. Also fixed that macro to actually work:-) --- Tools/bgen/bgen/bgenObjectDefinition.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 @@ 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() -- cgit v0.12