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
ce18721d
Unverified
Commit
ce18721d
authored
Jan 31, 2022
by
Aaron Gokaslan
Committed by
GitHub
Jan 31, 2022
Browse files
Ensure TypeError use raise_from for C++->Python overload res. (#3671)
parent
978617f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+7
-0
No files found.
include/pybind11/pybind11.h
View file @
ce18721d
...
...
@@ -988,6 +988,13 @@ protected:
}
append_note_if_missing_header_is_suspected
(
msg
);
#if PY_VERSION_HEX >= 0x03030000
// Attach additional error info to the exception if supported
if
(
PyErr_Occurred
())
{
raise_from
(
PyExc_TypeError
,
msg
.
c_str
());
return
nullptr
;
}
#endif
PyErr_SetString
(
PyExc_TypeError
,
msg
.
c_str
());
return
nullptr
;
}
...
...
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