From 16d43948456ee3c96a2c0b8bd9f446fc85a728b2 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Tue, 24 May 2016 09:19:35 +0200 Subject: [PATCH] Increase available information on invocation error. --- include/pybind11/pybind11.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index ee76a670..02d81e6f 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -422,6 +422,14 @@ protected: msg += it2->signature; msg += "\n"; } + msg += " Invoked with: "; + tuple args_(args, true); + for( std::size_t ti = 0; ti != args_.size(); ++ti) + { + msg += static_cast(static_cast(args_[ti]).str()); + if ((ti + 1) != args_.size() ) + msg += ", "; + } PyErr_SetString(PyExc_TypeError, msg.c_str()); return nullptr; } else if (!result) {