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

Include cause of toolkit import failure #1157

Merged
merged 1 commit into from
Aug 11, 2022
Merged
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
4 changes: 3 additions & 1 deletion pyface/base_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def import_toolkit(toolkit_name, entry_point="pyface.toolkits"):
module_names = ", ".join(module_names)
logger.warning(msg, entry_point, toolkit_name, module_names)

toolkit_exception = None
for plugin in plugins:
try:
toolkit_object = plugin.load()
Expand All @@ -222,11 +223,12 @@ def import_toolkit(toolkit_name, entry_point="pyface.toolkits"):
module_name = plugin.value.split(":")[0]
logger.info(msg, plugin.name, module_name)
logger.debug(exc, exc_info=True)
toolkit_exception = exc

msg = "No {} plugin could be loaded for {}"
msg = msg.format(entry_point, toolkit_name)
logger.info(msg)
raise RuntimeError(msg)
raise RuntimeError(msg) from toolkit_exception


def find_toolkit(entry_point, toolkits=None, priorities=default_priorities):
Expand Down