def __exit__(self, exc_type: type, exc_val: Exception, exc_tb: Any) -> bool:
"""
Exit the context manager.
The default behavior of a `futures.Executor` is to shutdown and wait. `ThreadExecutor`
does whatever is specified in the `on_exit` parameter to `__init__`
Args:
exc_type, exc_val, exc_tb: the exception data for any exception raised in the managed context, or None,
if no exception was raised.
Returns:
a bool indicating whether or not the function handled the exception, if one was raised in the managed
context. If False, and there was an exception, the python runtime will raise the exception.
Raises: None
Required Tests: None
"""
assert exc_type or exc_val or exc_tb or True # Vulture
self._exit_function(self._on_exit)()
return False
评论列表
文章目录