diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2006-04-20 21:38:17 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2006-04-20 21:38:17 (GMT) |
commit | f75225b448c9e16db83e24a39d3d709ede070e14 (patch) | |
tree | b3fd82431e15b02e65da79c3a3ac40d19b0e0247 /Tools | |
parent | 3b675d299c528272108dbdb1433ccfe9cbbf2ee1 (diff) | |
download | cpython-f75225b448c9e16db83e24a39d3d709ede070e14.zip cpython-f75225b448c9e16db83e24a39d3d709ede070e14.tar.gz cpython-f75225b448c9e16db83e24a39d3d709ede070e14.tar.bz2 |
- tp_init shouldn't call base class tp_init by default
- tp_new (which was apparently always overridden:-) called base class
tp_init in stead of tp_new.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/bgen/bgen/bgenObjectDefinition.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Tools/bgen/bgen/bgenObjectDefinition.py b/Tools/bgen/bgen/bgenObjectDefinition.py index a802f93..6f9bd53 100644 --- a/Tools/bgen/bgen/bgenObjectDefinition.py +++ b/Tools/bgen/bgen/bgenObjectDefinition.py @@ -383,6 +383,8 @@ class PEP253Mixin(PEP252Mixin): Output("%s_tp_free, /* tp_free */", self.prefix) def output_tp_initBody_basecall(self): + """If a type shares its init call with its base type set output_tp_initBody + to output_tp_initBody_basecall""" if self.basetype: Output("if (%s.tp_init)", self.basetype) OutLbrace() @@ -395,7 +397,6 @@ class PEP253Mixin(PEP252Mixin): if self.output_tp_initBody: Output("static int %s_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)", self.prefix) OutLbrace() - self.output_tp_initBody_basecall() self.output_tp_initBody() OutRbrace() else: @@ -425,7 +426,7 @@ class PEP253Mixin(PEP252Mixin): if self.basetype: Output("if (%s.tp_new)", self.basetype) OutLbrace() - Output("if ( (*%s.tp_init)(_self, _args, _kwds) == NULL) return NULL;", self.basetype) + Output("if ( (*%s.tp_new)(type, _args, _kwds) == NULL) return NULL;", self.basetype) Dedent() Output("} else {") Indent() |