summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2002-12-19 20:37:32 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2002-12-19 20:37:32 (GMT)
commit5bb2f6497f6b4455e4da64ef049bf43cd1c2215a (patch)
treefd287285cdfbe79b0df86545bb4f3853e4cba392
parent03d00d51ba420a1d92b9232568b15fb41fcf31aa (diff)
downloadcpython-5bb2f6497f6b4455e4da64ef049bf43cd1c2215a.zip
cpython-5bb2f6497f6b4455e4da64ef049bf43cd1c2215a.tar.gz
cpython-5bb2f6497f6b4455e4da64ef049bf43cd1c2215a.tar.bz2
Always output an inheritance-aware version of the xxxx_Check() macro. Also
fixed that macro to actually work:-)
-rw-r--r--Tools/bgen/bgen/bgenObjectDefinition.py6
1 files changed, 1 insertions, 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()