Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Allow errors when getting the Layout plugin to be raised (Main Window) #22672

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading