Skip to content

Commit

Permalink
Handle if variable is deleted before refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
jitseniesen committed Sep 7, 2023
1 parent c4b916b commit 7d3c0ad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spyder/plugins/variableexplorer/widgets/arrayeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,13 @@ def refresh(self):
if self.save_and_close_button.isEnabled():
if not self.ask_for_refresh_confirmation():
return
data = self.data_function()

try:
data = self.data_function()
except KeyError:
self.error(_('The variable no longer exists.'))
return

if not self.set_data_and_check(data):
self.error(
_('The new value cannot be displayed in the array editor.'))
Expand Down

0 comments on commit 7d3c0ad

Please sign in to comment.