From 9ba4a562541ff031e95b695d4939c83d165d6f70 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 28 Jan 2023 16:34:47 +0100 Subject: Use BaseException instead of Exception in task.py --- slack/task.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slack/task.py b/slack/task.py index facc0e2..149b180 100644 --- a/slack/task.py +++ b/slack/task.py @@ -38,7 +38,7 @@ class Future(Awaitable[T]): def __await__(self) -> Generator[Future[T], T, T]: result = yield self - if isinstance(result, Exception): + if isinstance(result, BaseException): raise result self.set_result(result) return result @@ -93,7 +93,7 @@ def task_runner(task: Task[Any], response: Any): while True: try: future = task.coroutine.send(response) - except Exception as e: + except BaseException as e: result = e.value if isinstance(e, StopIteration) else e process_ended_task(task, result) if isinstance(e, HttpError): -- cgit