From fc0e59c5c33779a1674fe3ddfbcc72d131036c21 Mon Sep 17 00:00:00 2001 From: J08nY Date: Mon, 19 Jun 2017 15:04:12 +0200 Subject: Don't fail when plugins pre_hook or post_hook fails. - Catches all exceptions raised when running a plugins (pre|post) _hooks. If its pre_hook raises an exception, the plugin is disabled and removed, so its post_hook will not be run and its components will not be loaded. If its post_hook raises an exception we just continue and hope for the best. --- src/mailman/utilities/plugins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mailman/utilities/plugins.py') diff --git a/src/mailman/utilities/plugins.py b/src/mailman/utilities/plugins.py index 98a34fbca..3fb5e49bc 100644 --- a/src/mailman/utilities/plugins.py +++ b/src/mailman/utilities/plugins.py @@ -57,8 +57,8 @@ def add_pluggable_components(subpackage, interface, mapping): object's `.name` attribute, which is required. It is a fatal error if that key already exists in the mapping. - :param package: The subpackage path to search. - :type package: string + :param subpackage: The subpackage path to search. + :type subpackage: string :param interface: The interface that returned objects must conform to. Objects found must have a `.name` attribute containing a unique string. @@ -70,7 +70,7 @@ def add_pluggable_components(subpackage, interface, mapping): """ for component in find_pluggable_components(subpackage, interface): if component.name in mapping: - raise RuntimeError( + raise RuntimeError( # pragma: no cover 'Duplicate key "{}" found in {}; previously {}'.format( component.name, component, mapping[component.name])) mapping[component.name] = component -- cgit v1.2.3-70-g09d2