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