mirror of https://github.com/swig/swig
fix regression of Python constructor renaming introduced by py3k work
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11997 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ff8f6b5c66
commit
2450c4b108
|
@ -1,6 +1,9 @@
|
|||
Version 2.0.0 (in progress)
|
||||
============================
|
||||
|
||||
2010-04-25: bhy
|
||||
[Python] Fix #2985655 - broken constructor renaming.
|
||||
|
||||
2010-04-14: wsfulton
|
||||
Typemap fragments are now official and documented in Typemaps.html.
|
||||
|
||||
|
|
|
@ -131,6 +131,7 @@ CPP_TEST_CASES += \
|
|||
constructor_exception \
|
||||
constructor_explicit \
|
||||
constructor_ignore \
|
||||
constructor_rename \
|
||||
constructor_value \
|
||||
contract \
|
||||
conversion \
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
%module constructor_rename
|
||||
|
||||
%{
|
||||
struct Foo {
|
||||
Foo() {}
|
||||
};
|
||||
%}
|
||||
|
||||
struct Foo {
|
||||
%rename(RenamedConstructor) Foo();
|
||||
Foo() {}
|
||||
};
|
|
@ -0,0 +1,3 @@
|
|||
from constructor_rename import *
|
||||
|
||||
x = RenamedConstructor()
|
|
@ -3258,6 +3258,7 @@ public:
|
|||
String *rclassname = Swig_class_name(getCurrentClass());
|
||||
assert(rclassname);
|
||||
|
||||
|
||||
String *parms = make_pyParmList(n, true, false, allow_kwargs);
|
||||
/* Pass 'self' only if using director */
|
||||
String *callParms = make_pyParmList(n, false, true, allow_kwargs);
|
||||
|
@ -3300,8 +3301,8 @@ public:
|
|||
Printv(f_shadow_stubs, pycode, "\n", NIL);
|
||||
Delete(pycode);
|
||||
} else {
|
||||
String *parms = make_pyParmList(n, true, false, allow_kwargs);
|
||||
String *callParms = make_pyParmList(n, true, true, allow_kwargs);
|
||||
String *parms = make_pyParmList(n, false, false, allow_kwargs);
|
||||
String *callParms = make_pyParmList(n, false, true, allow_kwargs);
|
||||
|
||||
Printv(f_shadow_stubs, "\ndef ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||
if (have_docstring(n))
|
||||
|
|
Loading…
Reference in New Issue