Skip to content

Commit bdd9dac

Browse files
committed
Main Window: Allow errors when getting the Layout plugin to be raised
1 parent 0f5a61a commit bdd9dac

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: spyder/app/mainwindow.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -780,12 +780,22 @@ def __getattr__(self, attr):
780780
as before, e.g self.console or self.main.console, preserving the
781781
same accessor as before.
782782
"""
783+
# It seems the Layout plugin is failing to be loaded under some
784+
# circumstances, so we need errors for it to be raised. That way,
785+
# they'll be reported by users on Github.
786+
# See spyder-ide/spyder#22639
787+
if attr == "layouts":
788+
return self.get_plugin(
789+
self._INTERNAL_PLUGINS_MAPPING[attr], error=True
790+
)
791+
783792
# Mapping of new plugin identifiers vs old attributtes
784793
# names given for plugins
785794
try:
786795
if attr in self._INTERNAL_PLUGINS_MAPPING.keys():
787796
return self.get_plugin(
788-
self._INTERNAL_PLUGINS_MAPPING[attr], error=False)
797+
self._INTERNAL_PLUGINS_MAPPING[attr], error=False
798+
)
789799
return self.get_plugin(attr)
790800
except SpyderAPIError:
791801
pass

0 commit comments

Comments
 (0)