From 67f2da7fbcb0749162c7d64004b34d40659977dc Mon Sep 17 00:00:00 2001 From: zhubonan <33688599+zhubonan@users.noreply.github.com> Date: Wed, 11 Jul 2018 17:18:41 +0100 Subject: [PATCH] fix bug in mixins.py when copying node `_sealed` attribute is not copied in superclass `Node.copy()` method and but here it tries to delete it again, which throws an `AttributeError` exception. We should use `clone._iter_updatable_attributes()` instead for deleting unwanted updatable attributes of the _clone_. --- aiida/orm/mixins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiida/orm/mixins.py b/aiida/orm/mixins.py index ffe5ad795d..6c6cb18e3a 100644 --- a/aiida/orm/mixins.py +++ b/aiida/orm/mixins.py @@ -96,7 +96,7 @@ def copy(self, include_updatable_attrs=False): # Remove the updatable attributes if not include_updatable_attrs: - for key, value in self._iter_updatable_attributes(): + for key, value in clone._iter_updatable_attributes(): clone._del_attr(key) return clone