We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b47b58a commit 8d11841Copy full SHA for 8d11841
include/pybind11/detail/common.h
@@ -251,7 +251,8 @@ extern "C" {
251
252
#define PYBIND11_CATCH_INIT_EXCEPTIONS \
253
catch (pybind11::error_already_set &e) { \
254
- PyErr_SetString(PyExc_ImportError, e.what()); \
+ e.caused(PyExc_ImportError, "initialization failed"); \
255
+ e.restore(); \
256
return nullptr; \
257
} catch (const std::exception &e) { \
258
PyErr_SetString(PyExc_ImportError, e.what()); \
0 commit comments