diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-01-28 16:34:47 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | 9ba4a562541ff031e95b695d4939c83d165d6f70 (patch) | |
tree | 394f38a1ab785d65177baa0574ce68d9eb13e252 | |
parent | 26d3c52e775a806756bfbfc4d8b39537ed94f6a6 (diff) | |
download | wee-slack-9ba4a562541ff031e95b695d4939c83d165d6f70.tar.gz |
Use BaseException instead of Exception in task.py
-rw-r--r-- | slack/task.py | 4 |
1 files 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): |