Skip to content

Commit

Permalink
Shorten PYBIND11_EMBEDDED_MODULE macro implementation by using PYBIND…
Browse files Browse the repository at this point in the history
…11_CATCH_INIT_EXCEPTIONS (#2579)
  • Loading branch information
YannickJadoul authored Oct 12, 2020
1 parent ae2e5a3 commit 1914b7d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions include/pybind11/embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,7 @@
try { \
PYBIND11_CONCAT(pybind11_init_, name)(m); \
return m.ptr(); \
} catch (::pybind11::error_already_set &e) { \
PyErr_SetString(PyExc_ImportError, e.what()); \
return nullptr; \
} catch (const std::exception &e) { \
PyErr_SetString(PyExc_ImportError, e.what()); \
return nullptr; \
} \
} PYBIND11_CATCH_INIT_EXCEPTIONS \
} \
PYBIND11_EMBEDDED_MODULE_IMPL(name) \
::pybind11::detail::embedded_module PYBIND11_CONCAT(pybind11_module_, name) \
Expand Down

0 comments on commit 1914b7d

Please sign in to comment.