From 18678214aefcef579adc070ad7ac52bc3a304f50 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 12 Dec 2017 16:20:59 +0100 Subject: [PATCH] interrogate: pass "args" tuple to function that takes PyObject *args --- dtool/src/interrogate/functionRemap.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index 27ec829479..42a420644f 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -797,6 +797,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak (_parameters[first_param + 1]._name == "kwargs" || _parameters[first_param + 1]._name == "kwds")) { _flags |= F_explicit_args; + _args_type = InterfaceMaker::AT_keyword_args; } } @@ -909,6 +910,13 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak break; } } + } else if (_args_type == InterfaceMaker::AT_single_arg) { + // If it takes an argument named "args", we are directly passing the + // "args" tuple to the function. + if (_parameters[first_param]._name == "args") { + _flags |= F_explicit_args; + _args_type = InterfaceMaker::AT_varargs; + } } } break;