diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2004-07-15 21:24:07 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2004-07-15 21:24:07 (GMT) |
commit | c572e42fb46d69da1ac6aadf919837b5f5ed58ff (patch) | |
tree | f98eea702963c99b61732bc078e85726f9d2639e | |
parent | 84b744775206eceefc9c94ba3e23f18332ac062b (diff) | |
download | cpython-c572e42fb46d69da1ac6aadf919837b5f5ed58ff.zip cpython-c572e42fb46d69da1ac6aadf919837b5f5ed58ff.tar.gz cpython-c572e42fb46d69da1ac6aadf919837b5f5ed58ff.tar.bz2 |
Call the correct tp_dealloc.
-rw-r--r-- | Tools/bgen/bgen/bgenObjectDefinition.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/bgen/bgen/bgenObjectDefinition.py b/Tools/bgen/bgen/bgenObjectDefinition.py index 40435ad..9c205e3 100644 --- a/Tools/bgen/bgen/bgenObjectDefinition.py +++ b/Tools/bgen/bgen/bgenObjectDefinition.py @@ -135,7 +135,7 @@ class ObjectDefinition(GeneratorGroup): OutLbrace() self.outputCleanupStructMembers() if self.basetype: - Output("%s.tp_dealloc(self)", self.basetype) + Output("self->ob_type->tp_base->tp_dealloc((PyObject *)self);") elif hasattr(self, 'output_tp_free'): # This is a new-style object with tp_free slot Output("self->ob_type->tp_free((PyObject *)self);") @@ -210,7 +210,7 @@ class ObjectDefinition(GeneratorGroup): def outputTypeObjectInitializer(self): Output("""%s.ob_type = &PyType_Type;""", self.typename) if self.basetype: - Output("%s.tp_base = %s;", self.typename, self.basetype) + Output("%s.tp_base = &%s;", self.typename, self.basetype) Output("if (PyType_Ready(&%s) < 0) return;", self.typename) Output("""Py_INCREF(&%s);""", self.typename) Output("PyModule_AddObject(m, \"%s\", (PyObject *)&%s);", self.name, self.typename); |