Skip to content

Commit 69aca59

Browse files
authored
Fix warning with pybind11 2.12 (#1389)
Signed-off-by: Steve Peters <[email protected]>
1 parent afd56d2 commit 69aca59

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/src/sdf/_gz_sdformat_pybind11.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) {
150150
sdfErrorsException.attr("errors") = pybind11::cast(e.Errors());
151151
// This has to be called last since it's the call that sets
152152
// PyErr_SetString.
153+
#if PYBIND11_VERSION_HEX >= 0x020C0000
154+
pybind11::set_error(sdfErrorsException, e.what());
155+
#else
153156
sdfErrorsException(e.what());
157+
#endif
154158
}
155159
});
156160

0 commit comments

Comments
 (0)