Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
3b48482f
Commit
3b48482f
authored
Jul 01, 2016
by
Wenzel Jakob
Committed by
GitHub
Jul 01, 2016
Browse files
Merge pull request #262 from merlinND/make-tuple-error-message
More informative error message when `py::make_tuple` fails
parents
00062595
68ca3b63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
include/pybind11/cast.h
include/pybind11/cast.h
+10
-3
No files found.
include/pybind11/cast.h
View file @
3b48482f
...
...
@@ -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
(
std
::
forward
<
Args
>
(
args_
),
policy
,
nullptr
),
false
)...
}
};
for
(
auto
&
arg_value
:
args
)
if
(
!
arg_value
)
throw
cast_error
(
"make_tuple(): unable to convert arguments to Python objects"
);
for
(
auto
&
arg_value
:
args
)
{
if
(
!
arg_value
)
{
#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
);
int
counter
=
0
;
for
(
auto
&
arg_value
:
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment