pylint disable broad excepts when it make sense.
This commit is contained in:
@ -53,12 +53,14 @@ class PluginExecutionContext:
|
|||||||
self.alive = True
|
self.alive = True
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
|
# pylint: disable=broad-except
|
||||||
try:
|
try:
|
||||||
get_initializer(self.plugin)(self)
|
get_initializer(self.plugin)(self)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self.handle_error(exc, traceback.format_exc())
|
self.handle_error(exc, traceback.format_exc())
|
||||||
|
|
||||||
def finalize(self):
|
def finalize(self):
|
||||||
|
# pylint: disable=broad-except
|
||||||
try:
|
try:
|
||||||
get_finalizer(self.plugin)(self)
|
get_finalizer(self.plugin)(self)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
@ -214,6 +216,7 @@ class ComponentExecutionContext(WithStatistics):
|
|||||||
self.send(_resolve(input_bag, output))
|
self.send(_resolve(input_bag, output))
|
||||||
|
|
||||||
def initialize(self):
|
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 '
|
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)
|
'initialization time.').format(type(self).__name__, NEW)
|
||||||
self.state = RUNNING
|
self.state = RUNNING
|
||||||
@ -224,6 +227,7 @@ class ComponentExecutionContext(WithStatistics):
|
|||||||
self.handle_error(exc, traceback.format_exc())
|
self.handle_error(exc, traceback.format_exc())
|
||||||
|
|
||||||
def finalize(self):
|
def finalize(self):
|
||||||
|
# pylint: disable=broad-except
|
||||||
assert self.state is RUNNING, ('A {} must be in {} state at finalization time.').format(
|
assert self.state is RUNNING, ('A {} must be in {} state at finalization time.').format(
|
||||||
type(self).__name__, RUNNING)
|
type(self).__name__, RUNNING)
|
||||||
self.state = TERMINATED
|
self.state = TERMINATED
|
||||||
|
|||||||
Reference in New Issue
Block a user