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 "
|
sf = self.static and "static "
|
||||||
Output("%sPyTypeObject %s;", sf, self.typename)
|
Output("%sPyTypeObject %s;", sf, self.typename)
|
||||||
Output()
|
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)
|
self.prefix, self.typename, self.typename)
|
||||||
else:
|
|
||||||
Output("#define %s_Check(x) ((x)->ob_type == &%s)",
|
|
||||||
self.prefix, self.typename)
|
|
||||||
Output()
|
Output()
|
||||||
Output("typedef struct %s {", self.objecttype)
|
Output("typedef struct %s {", self.objecttype)
|
||||||
IndentLevel()
|
IndentLevel()
|
||||||
|
|
Loading…
Reference in New Issue