Skip to content

Commit 856959c

Browse files
committed
Display exception string when loading a plugin failed
This helps with seeing what the issue is (e.g. with django-stubs [1]). It might be even better to have a traceback there already, no? 1: typeddjango/django-stubs#160
1 parent 28423cd commit 856959c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypy/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ def plugin_error(message: str) -> None:
381381

382382
try:
383383
module = importlib.import_module(module_name)
384-
except Exception:
385-
plugin_error("Error importing plugin '{}'".format(plugin_path))
384+
except Exception as exc:
385+
plugin_error("Error importing plugin '{}': {}".format(plugin_path, exc))
386386
finally:
387387
if plugin_dir is not None:
388388
assert sys.path[0] == plugin_dir

0 commit comments

Comments
 (0)