From 67b6f895975205ca1e311ec08079c9ed84c1d6a7 Mon Sep 17 00:00:00 2001 From: Joachim Ungar Date: Wed, 9 Mar 2022 14:26:11 +0100 Subject: [PATCH] don't raise KeyError when cleaning up futures --- mapchete/_executor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mapchete/_executor.py b/mapchete/_executor.py index bcdc1dd3..b9e267d3 100644 --- a/mapchete/_executor.py +++ b/mapchete/_executor.py @@ -180,7 +180,10 @@ def _finished_future(self, future, result=None, _dask=False): Release future from cluster explicitly and wrap result around FinishedFuture object. """ if not _dask: - self.running_futures.remove(future) + try: + self.running_futures.remove(future) + except KeyError: # pragma: no cover + pass self.finished_futures.discard(future) fut_exception = future.exception(timeout=FUTURE_TIMEOUT) if fut_exception: # pragma: no cover