smell: removes global catches, even if it may help in such critical places.

This commit is contained in:
Romain Dorgueil
2018-08-11 07:06:12 +02:00
parent 23e93c6970
commit 7ae1fa82f7
4 changed files with 6 additions and 6 deletions

View File

@ -67,7 +67,7 @@ class ConfigurableMeta(type):
try:
import _functools
except:
except Exception:
import functools
PartiallyConfigured = functools.partial

View File

@ -133,7 +133,7 @@ class ContextCurrifier:
try:
# todo yield from ? how to ?
processor.send(self._stack_values.pop())
except StopIteration as exc:
except StopIteration:
# This is normal, and wanted.
pass
else:

View File

@ -160,7 +160,7 @@ class NodeExecutionContext(BaseContext, WithStatistics):
if self._stack:
try:
self._stack.teardown()
except:
except Exception:
self.fatal(sys.exc_info())
super().stop()

View File

@ -29,7 +29,7 @@ class ExecutorStrategy(Strategy):
with self.create_executor(graph) as executor:
try:
context.start(self.get_starter(executor, futures))
except:
except Exception:
logger.critical('Exception caught while starting execution context.', exc_info=sys.exc_info())
while context.alive:
@ -53,14 +53,14 @@ class ExecutorStrategy(Strategy):
try:
with node:
node.loop()
except:
except Exception:
logging.getLogger(__name__).critical(
'Critical error in threadpool node starter.', exc_info=sys.exc_info()
)
try:
futures.append(executor.submit(_runner))
except:
except Exception:
logging.getLogger(__name__).critical('futures.append', exc_info=sys.exc_info())
return starter