From 5c5ca16bfcbc3badf26b500e5910f64fb6495df3 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Fri, 6 Jan 2006 17:16:25 +0000 Subject: [PATCH] disable kwargs in more cases git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8258 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/python.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 7f6582978..28651a48f 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -1270,8 +1270,7 @@ public: int check_kwargs(Node *n) { return (use_kw || GetFlag(n,"feature:kwargs")) - && !GetFlag(n,"memberset") && !GetFlag(n,"memberget") - && !checkAttribute(n,"nodeType","destructor"); + && !GetFlag(n,"memberset") && !GetFlag(n,"memberget"); } @@ -1490,6 +1489,8 @@ public: /* Get number of required and total arguments */ num_arguments = emit_num_arguments(l); num_required = emit_num_required(l); + if (((num_arguments == 0) && (num_required == 0)) || + ((num_arguments == 1) && (num_required == 1) && Getattr(l,"self"))) allow_kwargs = 0; varargs = emit_isvarargs(l); int funpack = modernargs && fastunpack && !varargs && !allow_kwargs ; int noargs = funpack && (num_required == 0 && num_arguments == 0);