提交 98d69535 编写于 作者: L Lucas Meneghel Rodrigues

Merge pull request #957 from clebergnu/loader_unique_dispatcher_propagate

Make loader registration unique and make dispatcher propagate exceptions
......@@ -27,7 +27,8 @@ class Dispatcher(ExtensionManager):
self.load_failures = []
super(Dispatcher, self).__init__(namespace=namespace,
invoke_on_load=True,
on_load_failure_callback=self.store_load_failure)
on_load_failure_callback=self.store_load_failure,
propagate_map_exceptions=True)
@staticmethod
def store_load_failure(manager, entrypoint, exception):
......
......@@ -102,7 +102,8 @@ class TestLoaderProxy(object):
def register_plugin(self, plugin):
try:
if issubclass(plugin, TestLoader):
self.registered_plugins.append(plugin)
if plugin not in self.registered_plugins:
self.registered_plugins.append(plugin)
else:
raise ValueError
except ValueError:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册