mirror of
https://github.com/PyCQA/flake8.git
synced 2026-06-29 00:30:44 +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:
|
||||
try:
|
||||
obj = plugin.entry_point.load()
|
||||
except Exception as e:
|
||||
except (AttributeError, ImportError, ModuleNotFoundError, ValueError) as e:
|
||||
raise FailedToLoadPlugin(plugin.package, e)
|
||||
|
||||
if not callable(obj):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue