From b19d0dc05ebbb30c97493686f389363e0244cdeb Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 3 Nov 2004 10:22:15 +0000 Subject: [PATCH] fix serious bug with def args + static methods git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6644 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- .../test-suite/python/default_args_runme.py | 17 +++++++++++++++++ Source/Modules/python.cxx | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 Examples/test-suite/python/default_args_runme.py diff --git a/Examples/test-suite/python/default_args_runme.py b/Examples/test-suite/python/default_args_runme.py new file mode 100644 index 000000000..6844e03bb --- /dev/null +++ b/Examples/test-suite/python/default_args_runme.py @@ -0,0 +1,17 @@ +import default_args + + +if default_args.Statics.staticmethod() != 60: + raise RuntimeError + +if default_args.cfunc1(1) != 2: + raise RuntimeError + +if default_args.cfunc2(1) != 3: + raise RuntimeError + +if default_args.cfunc3(1) != 4: + raise RuntimeError + + + diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 60196fa9f..e5b770cbe 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -2167,6 +2167,11 @@ public: virtual int staticmemberfunctionHandler(Node *n) { String *symname = Getattr(n,"sym:name"); Language::staticmemberfunctionHandler(n); + + if (Getattr(n,"sym:nextSibling")) { + return SWIG_OK; + } + if (shadow) { if ( !classic && !Getattr(n,"feature:python:callback") && have_addtofunc(n)) { int kw = (check_kwargs(n) && !Getattr(n,"sym:overloaded")) ? 1 : 0;