From 515c4ffebe167b0b4ebb5a1fe02d1d8450d3caa6 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Tue, 15 Oct 2024 16:11:08 -0700 Subject: [PATCH] Fix --- libs/langgraph/langgraph/pregel/executor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/langgraph/langgraph/pregel/executor.py b/libs/langgraph/langgraph/pregel/executor.py index af8cdf3a5..488f12661 100644 --- a/libs/langgraph/langgraph/pregel/executor.py +++ b/libs/langgraph/langgraph/pregel/executor.py @@ -93,8 +93,8 @@ class BackgroundExecutor(ContextManager): if cancel: task.cancel() # wait for all tasks to finish - if tasks := {t for t in tasks if not t.done()}: - concurrent.futures.wait(tasks) + if pending := {t for t in tasks if not t.done()}: + concurrent.futures.wait(pending) # shutdown the executor self.stack.__exit__(exc_type, exc_value, traceback) # re-raise the first exception that occurred in a task