mirror of https://github.com/python/cpython
Always output an inheritance-aware version of the xxxx_Check() macro. Also
fixed that macro to actually work:-)
This commit is contained in:
parent
03d00d51ba
commit
5bb2f6497f
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue