Skip to content

Commit

Permalink
Main Window: Allow errors when getting the Layout plugin to be raised
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Oct 14, 2024
1 parent a3920dd commit ffbfe30
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion spyder/app/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,22 @@ def __getattr__(self, attr):
as before, e.g self.console or self.main.console, preserving the
same accessor as before.
"""
# It seems the Layout plugin is failing to be loaded under some
# circumstances, so we need errors for it to be raised. That way,
# they'll be reported by users on Github.
# See spyder-ide/spyder#22639
if attr == "layouts":
return self.get_plugin(
self._INTERNAL_PLUGINS_MAPPING[attr], error=True
)

# Mapping of new plugin identifiers vs old attributtes
# names given for plugins
try:
if attr in self._INTERNAL_PLUGINS_MAPPING.keys():
return self.get_plugin(
self._INTERNAL_PLUGINS_MAPPING[attr], error=False)
self._INTERNAL_PLUGINS_MAPPING[attr], error=False
)
return self.get_plugin(attr)
except SpyderAPIError:
pass
Expand Down

0 comments on commit ffbfe30

Please sign in to comment.