Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,8 @@ void BindingBase::SetAttr(py::object self, const std::string& s, py::object valu
return;
}

/// We are falling back to dynamically adding the objet into the object dict.
py::dict t = self.attr("__dict__");
if(!t.is_none())
{
t[s.c_str()] = value;
return;
}

/// Well this should never happen unless there is no __dict__
throw py::attribute_error("Unable to set attribute '"+s+"', unknow data type");
// If it's not a data or a link, rely on object implementation of __setattr__
py::module::import("builtins").attr("object").attr("__setattr__")(self, s, value);
}

void BindingBase::SetAttr(Base& self, const std::string& s, py::object value)
Expand Down