mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-24 22:25:10 +00:00
don't set nested exception if already set
This commit is contained in:
parent
1bd0eaae06
commit
a8046ffe2d
@ -581,6 +581,7 @@ public:
|
|||||||
error_already_set()
|
error_already_set()
|
||||||
: m_fetched_error{new detail::error_fetch_and_normalize("pybind11::error_already_set"),
|
: m_fetched_error{new detail::error_fetch_and_normalize("pybind11::error_already_set"),
|
||||||
m_fetched_error_deleter} {
|
m_fetched_error_deleter} {
|
||||||
|
if (not nested_ptr())
|
||||||
static_cast<std::nested_exception&>(*this) = m_fetched_error->get_cause_as_nested();
|
static_cast<std::nested_exception&>(*this) = m_fetched_error->get_cause_as_nested();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user