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
912feec1
Commit
912feec1
authored
Apr 01, 2016
by
Wenzel Jakob
Browse files
improve debug error message when default parameter construction fails
parent
9e75905b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
include/pybind11/attr.h
include/pybind11/attr.h
+10
-4
No files found.
include/pybind11/attr.h
View file @
912feec1
...
@@ -233,11 +233,17 @@ struct process_attribute<arg_t<T>> : process_attribute_default<arg_t<T>> {
...
@@ -233,11 +233,17 @@ struct process_attribute<arg_t<T>> : process_attribute_default<arg_t<T>> {
#if !defined(NDEBUG)
#if !defined(NDEBUG)
std
::
string
descr
(
typeid
(
T
).
name
());
std
::
string
descr
(
typeid
(
T
).
name
());
detail
::
clean_type_id
(
descr
);
detail
::
clean_type_id
(
descr
);
if
(
r
->
class_
)
descr
=
"'"
+
std
::
string
(
a
.
name
)
+
": "
+
descr
+
"'"
;
descr
+=
" in method of "
+
(
std
::
string
)
r
->
class_
.
str
();
if
(
r
->
class_
)
{
if
(
r
->
name
)
descr
+=
" in method '"
+
(
std
::
string
)
r
->
class_
.
str
()
+
"."
+
(
std
::
string
)
r
->
name
+
"'"
;
else
descr
+=
" in method of '"
+
(
std
::
string
)
r
->
class_
.
str
()
+
"'"
;
}
else
if
(
r
->
name
)
{
descr
+=
" in function named '"
+
(
std
::
string
)
r
->
name
+
"'"
;
}
pybind11_fail
(
"arg(): could not convert default keyword argument "
pybind11_fail
(
"arg(): could not convert default keyword argument "
"of type "
+
descr
+
+
descr
+
" into a Python object (type not registered yet?)"
);
" into a Python object (type not registered yet?)"
);
#else
#else
pybind11_fail
(
"arg(): could not convert default keyword argument "
pybind11_fail
(
"arg(): could not convert default keyword argument "
"into a Python object (type not registered yet?). "
"into a Python object (type not registered yet?). "
...
...
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