Skip to content

Commit

Permalink
python: Remove Path management in extract(bp::list) to avoid issue wh…
Browse files Browse the repository at this point in the history
…en working with a non string vector
  • Loading branch information
jorisv committed Oct 2, 2024
1 parent 920da20 commit 2001728
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions include/pinocchio/bindings/python/utils/list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,12 @@ namespace pinocchio
vec[i] = input_T();
else
{
const std::string modulename = bp::extract<std::string>(list[i].attr("__module__"));
if (modulename == std::string("pathlib"))
vec[i] = path(list[i]);
else
{
const std::string classname =
bp::extract<std::string>(list[i].attr("__class__").attr("__name__"));
std::stringstream ss;
ss << "The conversion from " << classname << " to " << bp::type_id<T>().name()
<< " has failed." << std::endl;
throw eigenpy::Exception(ss.str());
}
const std::string classname =
bp::extract<std::string>(list[i].attr("__class__").attr("__name__"));
std::stringstream ss;
ss << "The conversion from " << classname << " to " << bp::type_id<T>().name()
<< " has failed." << std::endl;
throw eigenpy::Exception(ss.str());
}
}
}
Expand Down

0 comments on commit 2001728

Please sign in to comment.