summaryrefslogtreecommitdiff
path: root/Tools/bgen
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2002-12-19 20:37:32 +0000
committerJack Jansen <jack.jansen@cwi.nl>2002-12-19 20:37:32 +0000
commit1229cea90329d319b069b3c110560e633c6fb8c9 (patch)
treef6489fe93ba6374d24fd1bef0e4486c00ad91820 /Tools/bgen
parent348ca9485539e9d46b5b9fe33f52aed536eb9b5f (diff)
downloadcpython-1229cea90329d319b069b3c110560e633c6fb8c9.tar.gz
Always output an inheritance-aware version of the xxxx_Check() macro. Also
fixed that macro to actually work:-)
Diffstat (limited to 'Tools/bgen')
-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 c409260e95..510b9b8442 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()