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)
|
Version 2.0.0 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
2010-04-25: bhy
|
||||||
|
[Python] Fix #2985655 - broken constructor renaming.
|
||||||
|
|
||||||
2010-04-14: wsfulton
|
2010-04-14: wsfulton
|
||||||
Typemap fragments are now official and documented in Typemaps.html.
|
Typemap fragments are now official and documented in Typemaps.html.
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,7 @@ CPP_TEST_CASES += \
|
||||||
constructor_exception \
|
constructor_exception \
|
||||||
constructor_explicit \
|
constructor_explicit \
|
||||||
constructor_ignore \
|
constructor_ignore \
|
||||||
|
constructor_rename \
|
||||||
constructor_value \
|
constructor_value \
|
||||||
contract \
|
contract \
|
||||||
conversion \
|
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()
|
|
@ -3257,6 +3257,7 @@ public:
|
||||||
String *classname = Swig_class_name(parent);
|
String *classname = Swig_class_name(parent);
|
||||||
String *rclassname = Swig_class_name(getCurrentClass());
|
String *rclassname = Swig_class_name(getCurrentClass());
|
||||||
assert(rclassname);
|
assert(rclassname);
|
||||||
|
|
||||||
|
|
||||||
String *parms = make_pyParmList(n, true, false, allow_kwargs);
|
String *parms = make_pyParmList(n, true, false, allow_kwargs);
|
||||||
/* Pass 'self' only if using director */
|
/* Pass 'self' only if using director */
|
||||||
|
@ -3300,8 +3301,8 @@ public:
|
||||||
Printv(f_shadow_stubs, pycode, "\n", NIL);
|
Printv(f_shadow_stubs, pycode, "\n", NIL);
|
||||||
Delete(pycode);
|
Delete(pycode);
|
||||||
} else {
|
} else {
|
||||||
String *parms = make_pyParmList(n, true, false, allow_kwargs);
|
String *parms = make_pyParmList(n, false, false, allow_kwargs);
|
||||||
String *callParms = make_pyParmList(n, true, true, allow_kwargs);
|
String *callParms = make_pyParmList(n, false, true, allow_kwargs);
|
||||||
|
|
||||||
Printv(f_shadow_stubs, "\ndef ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
Printv(f_shadow_stubs, "\ndef ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||||
if (have_docstring(n))
|
if (have_docstring(n))
|
||||||
|
|
Loading…
Reference in New Issue