Skip to content
Snippets Groups Projects

model: Fix recursive update_from: Don't mess up NamespaceSet references

Merged Michael Thies requested to merge fix/recursive_update_from into master
2 files
+ 15
6
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 4
3
@@ -553,13 +553,14 @@ class Referable(metaclass=abc.ABCMeta):
recursively
"""
for name, var in vars(other).items():
# do not update the parent or source (depending on update_source parameter)
if name == "parent" or name == "source" and not update_source:
# do not update the parent, namespace_element_sets or source (depending on update_source parameter)
if name in ("parent", "namespace_element_sets") or name == "source" and not update_source:
continue
if isinstance(var, NamespaceSet):
# update the elements of the NameSpaceSet
vars(self)[name].update_nss_from(var)
vars(self)[name] = var # that variable is not a NameSpaceSet, so it isn't Referable
else:
vars(self)[name] = var # that variable is not a NameSpaceSet, so it isn't Referable
def commit(self) -> None:
"""
Loading