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
4fee1799
Commit
4fee1799
authored
Feb 09, 2016
by
Wenzel Jakob
Browse files
better debug info when arg::operator=() fails
parent
4f8902a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
include/pybind11/attr.h
include/pybind11/attr.h
+15
-5
No files found.
include/pybind11/attr.h
View file @
4fee1799
...
@@ -229,11 +229,21 @@ struct process_attribute<arg_t<T>> : process_attribute_default<arg_t<T>> {
...
@@ -229,11 +229,21 @@ struct process_attribute<arg_t<T>> : process_attribute_default<arg_t<T>> {
object
o
=
object
(
detail
::
type_caster
<
typename
detail
::
intrinsic_type
<
T
>::
type
>::
cast
(
object
o
=
object
(
detail
::
type_caster
<
typename
detail
::
intrinsic_type
<
T
>::
type
>::
cast
(
a
.
value
,
return_value_policy
::
automatic
,
handle
()),
false
);
a
.
value
,
return_value_policy
::
automatic
,
handle
()),
false
);
if
(
!
o
)
if
(
!
o
)
{
pybind11_fail
(
"arg(): could not convert default keyword "
#if !defined(NDEBUG)
"argument into a Python object (type not "
std
::
string
descr
(
typeid
(
T
).
name
());
"registered yet?)"
);
detail
::
clean_type_id
(
descr
);
if
(
r
->
class_
)
descr
+=
" in method of "
+
(
std
::
string
)
r
->
class_
.
str
();
pybind11_fail
(
"arg(): could not convert default keyword argument "
"of type "
+
descr
+
" into a Python object (type not registered yet?)"
);
#else
pybind11_fail
(
"arg(): could not convert default keyword argument "
"into a Python object (type not registered yet?). "
"Compile in debug mode for more information."
);
#endif
}
r
->
args
.
emplace_back
(
a
.
name
,
a
.
descr
,
o
.
release
());
r
->
args
.
emplace_back
(
a
.
name
,
a
.
descr
,
o
.
release
());
}
}
};
};
...
...
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