Skip to content

Commit

Permalink
[core/python] Avoid using raw C typeid. (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
duburcqa authored Feb 9, 2024
1 parent bf150c0 commit c904739
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions python/jiminy_pywrap/include/jiminy/python/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,9 @@ namespace jiminy::python
having to generate them manually. It simply consists in adding some special tags on top
of the docstring, which works for now but it is not robust and may break in the future
as this is an undocumented feature. */
const bp::converter::registration * r =
bp::converter::registry::query(typeid(WrappedClassT));
assert((std::string("Class ") + typeid(WrappedClassT).name() +
" not registered to Boost Python.",
auto wrapperTypeId = bp::type_id<WrappedClassT>();
const bp::converter::registration * r = bp::converter::registry::query(wrapperTypeId);
assert((std::string("Class ") + wrapperTypeId.name() + " not registered to Boost Python.",
r != nullptr));
PyTypeObject * nsPtr = r->get_class_object();
bp::object nsName(
Expand Down

0 comments on commit c904739

Please sign in to comment.