diff --git a/CHANGELOG.md b/CHANGELOG.md index 34fc5a7c9..b37bf7b18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `EventListener.event_types` and the argument to `BaseEventListenerDriver.handler` being out of sync. - Models occasionally hallucinating `memory_name` and `artifact_namespace` into Tool schemas when using `ToolkitTask`. - Models occasionally providing overly succinct final answers when using `ToolkitTask`. +- Exception getting raised in `FuturesExecutorMixin.__del__`. ## \[0.33.1\] - 2024-10-11 diff --git a/griptape/mixins/futures_executor_mixin.py b/griptape/mixins/futures_executor_mixin.py index 84a3b6f25..8c309d9b7 100644 --- a/griptape/mixins/futures_executor_mixin.py +++ b/griptape/mixins/futures_executor_mixin.py @@ -1,5 +1,6 @@ from __future__ import annotations +import contextlib from abc import ABC from concurrent import futures from typing import Callable, Optional @@ -23,4 +24,6 @@ def __del__(self) -> None: if executor is not None: self.futures_executor = None - executor.shutdown(wait=True) + with contextlib.suppress(Exception): + # don't raise exceptions in __del__ + executor.shutdown(wait=True)