mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-19 17:32:37 +00:00
more informative error message when py::make_tuple fails
This commit is contained in:
parent
0006259508
commit
68ca3b6343
@ -838,9 +838,16 @@ template <return_value_policy policy = return_value_policy::automatic_reference,
|
|||||||
{ object(detail::type_caster<typename detail::intrinsic_type<Args>::type>::cast(
|
{ object(detail::type_caster<typename detail::intrinsic_type<Args>::type>::cast(
|
||||||
std::forward<Args>(args_), policy, nullptr), false)... }
|
std::forward<Args>(args_), policy, nullptr), false)... }
|
||||||
};
|
};
|
||||||
for (auto &arg_value : args)
|
for (auto &arg_value : args) {
|
||||||
if (!arg_value)
|
if (!arg_value) {
|
||||||
throw cast_error("make_tuple(): unable to convert arguments to Python objects");
|
#if defined(NDEBUG)
|
||||||
|
throw cast_error("make_tuple(): unable to convert arguments to Python object (compile in debug mode for details)");
|
||||||
|
#else
|
||||||
|
throw cast_error("make_tuple(): unable to convert arguments of types '" +
|
||||||
|
(std::string) type_id<std::tuple<Args...>>() + "' to Python object");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
tuple result(size);
|
tuple result(size);
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
for (auto &arg_value : args)
|
for (auto &arg_value : args)
|
||||||
|
Loading…
Reference in New Issue
Block a user