Overloaded C++ function Python wrappers now raise a TypeError instead of NotImplementedError
Occurs when the types passed are incorrect. This change means there is now consistency with non-overloaded function wrappers which have always raised TypeError when the incorrect types are passed. See issue #1293
This commit is contained in:
parent
8f224694e7
commit
fd651ff4e2
6 changed files with 32 additions and 14 deletions
|
|
@ -2645,7 +2645,7 @@ public:
|
|||
Delete(fulldecl);
|
||||
} while ((sibl = Getattr(sibl, "sym:nextSibling")));
|
||||
Append(f->code, "fail:\n");
|
||||
Printf(f->code, " SWIG_SetErrorMsg(PyExc_NotImplementedError,"
|
||||
Printf(f->code, " SWIG_SetErrorMsg(PyExc_TypeError,"
|
||||
"\"Wrong number or type of arguments for overloaded function '%s'.\\n\"" "\n\" Possible C/C++ prototypes are:\\n\"%s);\n", symname, protoTypes);
|
||||
Printf(f->code, "return %s;\n", builtin_ctor ? "-1" : "0");
|
||||
Delete(protoTypes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue