Skip to content

Commit

Permalink
Update pybind11 to version 2.12.0
Browse files Browse the repository at this point in the history
Currently used branch was not interoperable with a standard version of pybind11.
  • Loading branch information
rhaschke committed May 29, 2024
1 parent ad5c878 commit 8fa66a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repos:
- id: catkin_lint
name: catkin_lint
description: Check package.xml and cmake files
entry: catkin_lint .
entry: catkin_lint . --ignore duplicate_cmd
language: system
always_run: true
pass_filenames: false
Expand Down
6 changes: 4 additions & 2 deletions core/python/bindings/src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ void setForwardedProperties(Stage& self, const py::object& names) {

void export_core(pybind11::module& m) {
/// translate InitStageException into InitStageError
static py::exception<InitStageException> init_stage_error(m, "InitStageError");
PYBIND11_CONSTINIT static py::gil_safe_call_once_and_store<py::object> exc_storage;
exc_storage.call_once_and_store_result([&]() { return py::exception<InitStageException>(m, "InitStageError"); });

/// provide extended error description for InitStageException
py::register_exception_translator([](std::exception_ptr p) { // NOLINT(performance-unnecessary-value-param)
try {
Expand All @@ -89,7 +91,7 @@ void export_core(pybind11::module& m) {
} catch (const InitStageException& e) {
std::stringstream message;
message << e;
init_stage_error(message.str().c_str());
py::set_error(exc_storage.get_stored(), message.str().c_str());
}
});

Expand Down
2 changes: 1 addition & 1 deletion core/python/pybind11
Submodule pybind11 updated 292 files

0 comments on commit 8fa66a6

Please sign in to comment.