Skip to content

Commit

Permalink
Use 'raise from' in initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Jul 17, 2020
1 parent 4096c12 commit 80bd01f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ extern "C" {

#define PYBIND11_CATCH_INIT_EXCEPTIONS \
catch (pybind11::error_already_set &e) { \
PyErr_SetString(PyExc_ImportError, e.what()); \
e.caused(PyExc_ImportError, "initialization failed"); \
e.restore(); \
return nullptr; \
} catch (const std::exception &e) { \
PyErr_SetString(PyExc_ImportError, e.what()); \
Expand Down

0 comments on commit 80bd01f

Please sign in to comment.