mirror of
https://github.com/PyCQA/flake8.git
synced 2026-07-02 09:59:31 +00:00
narrow _load_plugin exception handler to the attribute/import/module-not-found/value errors that importlib.metadata.EntryPoint.load() can actually raise
This commit is contained in:
parent
bb943328ef
commit
b01e9d1eed
1 changed files with 1 additions and 1 deletions
|
|
@ -289,7 +289,7 @@ def _parameters_for(func: Any) -> dict[str, bool]:
|
||||||
def _load_plugin(plugin: Plugin) -> LoadedPlugin:
|
def _load_plugin(plugin: Plugin) -> LoadedPlugin:
|
||||||
try:
|
try:
|
||||||
obj = plugin.entry_point.load()
|
obj = plugin.entry_point.load()
|
||||||
except Exception as e:
|
except (AttributeError, ImportError, ModuleNotFoundError, ValueError) as e:
|
||||||
raise FailedToLoadPlugin(plugin.package, e)
|
raise FailedToLoadPlugin(plugin.package, e)
|
||||||
|
|
||||||
if not callable(obj):
|
if not callable(obj):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue