Skip to content

Commit e843246

Browse files
authored
Merge pull request #3603 from VesnaT/fix_migrate_context
[FIX] migrate_context: widgets crash when migrating context without version
2 parents edd3a30 + 961d202 commit e843246

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Orange/widgets/settings.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,11 @@ def pack_data(self, widget):
668668
"""Call the inherited method, then add local contexts to the dict."""
669669
data = super().pack_data(widget)
670670
self.settings_from_widget(widget)
671-
for context in widget.context_settings:
671+
context_settings = [copy.copy(context) for context in
672+
widget.context_settings]
673+
for context in context_settings:
672674
context.values[VERSION_KEY] = self.widget_class.settings_version
673-
data["context_settings"] = widget.context_settings
675+
data["context_settings"] = context_settings
674676
return data
675677

676678
def update_defaults(self, widget):

0 commit comments

Comments
 (0)