Skip to content

Commit

Permalink
Don't clone the 'preferences' trait
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickinson committed Jul 15, 2024
1 parent ea5add0 commit 07a563b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion envisage/ui/tasks/preferences_pane.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ def trait_context(self):
else:
raise ValueError("A preferences pane must have a model!")

self._model = self.model.clone_traits()
# Make sure that we don't clone the preferences trait, since that
# can lead to the preferences node being updated prematurely.
# xref: enthought/envisage#582
traits_to_clone = [
trait_name for trait_name in self.model.copyable_trait_names()
if trait_name != "preferences"
]
self._model = self.model.clone_traits(traits_to_clone)
self._model.preferences = None
return {"object": self._model, "controller": self, "handler": self}

Expand Down

0 comments on commit 07a563b

Please sign in to comment.