From b9e15aac41be1faa43ec50f74e5c21fe978b761e Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Tue, 31 Dec 2019 13:20:56 -0500 Subject: [PATCH] Make sure Processor is is given at least one EventHandler --- tracetools_analysis/tracetools_analysis/processor/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tracetools_analysis/tracetools_analysis/processor/__init__.py b/tracetools_analysis/tracetools_analysis/processor/__init__.py index 64c6d27..83b348d 100644 --- a/tracetools_analysis/tracetools_analysis/processor/__init__.py +++ b/tracetools_analysis/tracetools_analysis/processor/__init__.py @@ -272,6 +272,8 @@ class Processor(): :param kwargs: the parameters to pass on to new handlers """ self._initial_handlers = list(handlers) + if len(self._initial_handlers) == 0: + raise RuntimeError('Must provide at least one handler!') self._expanded_handlers = self._expand_dependencies(*handlers, **kwargs) self._handler_multimap = self._get_handler_maps(self._expanded_handlers) self._register_with_handlers(self._expanded_handlers)