diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 0773b3678..ab6cc3473 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -398,6 +398,7 @@ public: try { m_lazy_what = detail::error_string(m_type.ptr(), m_value.ptr(), m_trace.ptr()); } catch (...) { + PyErr_SetString(PyExc_RuntimeError, "Unknown internal error occurred"); return "Unknown internal error occurred"; } }