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:
Zo Bot 2026-06-12 13:48:25 +00:00
parent bb943328ef
commit b01e9d1eed

View file

@ -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):