From 95eeaefd1e21e4c180d65b8a2606b994e7296a14 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Sun, 13 Feb 2022 13:30:16 -0500 Subject: [PATCH] Improve error message in rare case --- include/pybind11/pytypes.h | 1 + 1 file changed, 1 insertion(+) 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"; } }