Commit de6f5b7d authored by Dominik Charousset's avatar Dominik Charousset

Port caf_python to new uniform_type_info_map API

parent 9085748e
...@@ -475,18 +475,19 @@ pybind11::tuple tuple_from_message(const type_erased_tuple& msg) { ...@@ -475,18 +475,19 @@ pybind11::tuple tuple_from_message(const type_erased_tuple& msg) {
auto& self = s_context->self; auto& self = s_context->self;
auto& bindings = s_context->cfg.portable_bindings(); auto& bindings = s_context->cfg.portable_bindings();
pybind11::tuple result(msg.size()); pybind11::tuple result(msg.size());
auto& types = self->system().types();
for (size_t i = 0; i < msg.size(); ++i) { for (size_t i = 0; i < msg.size(); ++i) {
auto rtti = msg.type(i); auto rtti = msg.type(i);
auto str_ptr = self->system().types().portable_name(rtti); auto str = types.portable_name(rtti);
if (str_ptr == nullptr) { if (str == types.default_type_name()) {
set_py_exception("Unable to extract element #", i, " from message: ", set_py_exception("Unable to extract element #", i, " from message: ",
"could not get portable name of ", rtti.second->name()); "could not get portable name of ", rtti.second->name());
return pybind11::tuple{}; return pybind11::tuple{};
} }
auto kvp = bindings.find(*str_ptr); auto kvp = bindings.find(str);
if (kvp == bindings.end()) { if (kvp == bindings.end()) {
set_py_exception(R"(Unable to add element of type ")", set_py_exception(R"(Unable to add element of type ")", str,
*str_ptr, R"(" to message: type is unknown to CAF)"); R"(" to message: type is unknown to CAF)");
return pybind11::tuple{}; return pybind11::tuple{};
} }
auto obj = kvp->second->to_object(msg, i); auto obj = kvp->second->to_object(msg, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment