Skip to content

Commit

Permalink
report type of passed argument when conversion fails
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Coder committed Nov 7, 2021
1 parent 3d656ed commit ff2b1e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/CPPMethod.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,10 @@ bool CPyCppyy::CPPMethod::ConvertAndSetArgs(CPyCppyy_PyArgs_t args, size_t nargs
bool isOK = true;
Parameter* cppArgs = ctxt->GetArgs(argc);
for (int i = 0; i < (int)argc; ++i) {
if (!fConverters[i]->SetArg(CPyCppyy_PyArgs_GET_ITEM(args, i), cppArgs[i], ctxt)) {
SetPyError_(CPyCppyy_PyText_FromFormat("could not convert argument %d", i+1));
PyObject *item = CPyCppyy_PyArgs_GET_ITEM(args, i);
if (!fConverters[i]->SetArg(item, cppArgs[i], ctxt)) {
std::string s = Utility::ClassName(item);
SetPyError_(CPyCppyy_PyText_FromFormat("could not convert argument %d of type %s", i+1, s.c_str()));
isOK = false;
break;
}
Expand Down

0 comments on commit ff2b1e7

Please sign in to comment.