From: Jack Jansen Date: Thu, 19 Dec 2002 20:37:32 +0000 (+0000) Subject: Always output an inheritance-aware version of the xxxx_Check() macro. Also X-Git-Tag: v2.3c1~2950 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5bb2f6497f6b4455e4da64ef049bf43cd1c2215a;p=thirdparty%2FPython%2Fcpython.git 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 c409260e9549..510b9b8442d3 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()