From 20397bcfef3837ad567a4c30a699a0738b67768c Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Mon, 26 Dec 2016 14:03:27 +0100 Subject: [PATCH] pylint disable broad excepts when it make sense. --- bonobo/core/contexts.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bonobo/core/contexts.py b/bonobo/core/contexts.py index 9a82062..31ecf6e 100644 --- a/bonobo/core/contexts.py +++ b/bonobo/core/contexts.py @@ -53,12 +53,14 @@ class PluginExecutionContext: self.alive = True def initialize(self): + # pylint: disable=broad-except try: get_initializer(self.plugin)(self) except Exception as exc: self.handle_error(exc, traceback.format_exc()) def finalize(self): + # pylint: disable=broad-except try: get_finalizer(self.plugin)(self) except Exception as exc: @@ -214,6 +216,7 @@ class ComponentExecutionContext(WithStatistics): self.send(_resolve(input_bag, output)) def initialize(self): + # pylint: disable=broad-except assert self.state is NEW, ('A {} can only be run once, and thus is expected to be in {} state at ' 'initialization time.').format(type(self).__name__, NEW) self.state = RUNNING @@ -224,6 +227,7 @@ class ComponentExecutionContext(WithStatistics): self.handle_error(exc, traceback.format_exc()) def finalize(self): + # pylint: disable=broad-except assert self.state is RUNNING, ('A {} must be in {} state at finalization time.').format( type(self).__name__, RUNNING) self.state = TERMINATED