From f38d8213d7394a8ba1dc6ae4737759eef8e0f9f8 Mon Sep 17 00:00:00 2001 From: Max Halford Date: Mon, 7 Oct 2024 06:22:19 +0200 Subject: [PATCH] Update runner.py --- lea/runner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lea/runner.py b/lea/runner.py index f60db81..0e17c0e 100644 --- a/lea/runner.py +++ b/lea/runner.py @@ -62,12 +62,15 @@ def status(self): @property def error(self) -> BaseException | None: - return self.future.exception() + if self.future.done() and self.future.exception(): + return self.future.exception() + return None @property def cost(self) -> float | None: if result := self.future.result(): return result.cost + return None class Runner: