Skip to content

Commit 2001728

Browse files
committed
python: Remove Path management in extract(bp::list) to avoid issue when working with a non string vector
1 parent 920da20 commit 2001728

File tree

1 file changed

+6
-12
lines changed
  • include/pinocchio/bindings/python/utils

1 file changed

+6
-12
lines changed

include/pinocchio/bindings/python/utils/list.hpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,12 @@ namespace pinocchio
3535
vec[i] = input_T();
3636
else
3737
{
38-
const std::string modulename = bp::extract<std::string>(list[i].attr("__module__"));
39-
if (modulename == std::string("pathlib"))
40-
vec[i] = path(list[i]);
41-
else
42-
{
43-
const std::string classname =
44-
bp::extract<std::string>(list[i].attr("__class__").attr("__name__"));
45-
std::stringstream ss;
46-
ss << "The conversion from " << classname << " to " << bp::type_id<T>().name()
47-
<< " has failed." << std::endl;
48-
throw eigenpy::Exception(ss.str());
49-
}
38+
const std::string classname =
39+
bp::extract<std::string>(list[i].attr("__class__").attr("__name__"));
40+
std::stringstream ss;
41+
ss << "The conversion from " << classname << " to " << bp::type_id<T>().name()
42+
<< " has failed." << std::endl;
43+
throw eigenpy::Exception(ss.str());
5044
}
5145
}
5246
}

0 commit comments

Comments
 (0)