]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Always output an inheritance-aware version of the xxxx_Check() macro. Also
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 19 Dec 2002 20:37:32 +0000 (20:37 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 19 Dec 2002 20:37:32 +0000 (20:37 +0000)
fixed that macro to actually work:-)

Tools/bgen/bgen/bgenObjectDefinition.py

index c409260e954919af5fc493b66b2f7f7198894354..510b9b8442d3e65563b506742208dab2ead879c0 100644 (file)
@@ -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()