From b5475abeefe08588b09c9f662e79ac1006a54944 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Thu, 28 Mar 2024 17:20:15 -0700 Subject: [PATCH] Fix warning with pybind11 2.12 (#1389) Signed-off-by: Steve Peters --- python/src/sdf/_gz_sdformat_pybind11.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/src/sdf/_gz_sdformat_pybind11.cc b/python/src/sdf/_gz_sdformat_pybind11.cc index a6f587193..80caf4396 100644 --- a/python/src/sdf/_gz_sdformat_pybind11.cc +++ b/python/src/sdf/_gz_sdformat_pybind11.cc @@ -141,7 +141,11 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { sdfErrorsException.attr("errors") = pybind11::cast(e.Errors()); // This has to be called last since it's the call that sets // PyErr_SetString. +#if PYBIND11_VERSION_HEX >= 0x020C0000 + pybind11::set_error(sdfErrorsException, e.what()); +#else sdfErrorsException(e.what()); +#endif } });