mirror of
https://github.com/pybind/pybind11.git
synced 2024-12-02 01:47:12 +00:00
Add noexcept move and explicit fail throw
This commit is contained in:
parent
f8d3ed22bf
commit
b90bd783f0
@ -391,7 +391,7 @@ public:
|
||||
}
|
||||
|
||||
error_already_set(const error_already_set &) = default;
|
||||
error_already_set(error_already_set &&) = default;
|
||||
error_already_set(error_already_set &&) noexcept = default;
|
||||
|
||||
inline ~error_already_set() override;
|
||||
|
||||
@ -419,6 +419,9 @@ public:
|
||||
/// error variables (but the `.what()` string is still available).
|
||||
void restore() {
|
||||
what(); // Force-build `.what()`.
|
||||
if (m_lazy_what.empty()) {
|
||||
pybind11_fail("Critical error building lazy error_string().");
|
||||
}
|
||||
if (m_type) {
|
||||
PyErr_Restore(
|
||||
m_type.release().ptr(), m_value.release().ptr(), m_trace.release().ptr());
|
||||
|
Loading…
Reference in New Issue
Block a user