From be7fdab62edbba18d9c0442607691c74d3438c8f Mon Sep 17 00:00:00 2001 From: Haoyu Bai Date: Sat, 31 Jan 2009 13:38:39 +0000 Subject: [PATCH] Fix SF#2552048. Remove the 'self' parameter in Python proxy code for static member function. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11099 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 4 ++++ Examples/test-suite/python/cpp_static_runme.py | 7 +++++++ Source/Modules/python.cxx | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Examples/test-suite/python/cpp_static_runme.py diff --git a/CHANGES.current b/CHANGES.current index 42c47b154..a474e10e1 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,5 +1,9 @@ Version 1.3.38 (in progress) ================================ +2008-01-31: bhy + [Python] Fix SF#2552048 reported by Gaetan Lehmann. The parameter list + of static member function in generated proxy code should not have the + 'self' parameter. 2008-01-29: wsfulton Fix regression introduced in 1.3.37 where the default output directory diff --git a/Examples/test-suite/python/cpp_static_runme.py b/Examples/test-suite/python/cpp_static_runme.py new file mode 100644 index 000000000..ef8623359 --- /dev/null +++ b/Examples/test-suite/python/cpp_static_runme.py @@ -0,0 +1,7 @@ +#!/usr/bin/evn python +from cpp_static import * +StaticFunctionTest.static_func() +StaticFunctionTest.static_func_2(1) +StaticFunctionTest.static_func_3(1,2) +StaticMemberTest.static_int = 10 +assert StaticMemberTest.static_int == 10 diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index fd4e9be8b..000078524 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -3159,8 +3159,8 @@ public: if (shadow) { if (!classic && !Getattr(n, "feature:python:callback") && have_addtofunc(n)) { int kw = (check_kwargs(n) && !Getattr(n, "sym:overloaded")) ? 1 : 0; - String *parms = make_pyParmList(n, true, false, kw); - String *callParms = make_pyParmList(n, true, true, kw); + String *parms = make_pyParmList(n, false, false, kw); + String *callParms = make_pyParmList(n, false, true, kw); Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); if (have_docstring(n)) Printv(f_shadow, tab8, docstring(n, AUTODOC_STATICFUNC, tab8), "\n", NIL);