[Bugfix] Catch asyncio.TimeoutError so duplex serving starts on Python 3.10 (#7412)
Signed-off-by: Tianyao Wu <rayroy31@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Alicia <115451386+congw729@users.noreply.github.com>
This commit is contained in:
6 files changed
+76
-4
No files matched your search
@@ -141,7 +141,8 @@ class DuplexSessionTasks:
|
||||
task.cancel()
|
||||
try:
|
||||
await asyncio.wait_for(asyncio.gather(*tasks, return_exceptions=True), timeout=timeout_s)
|
||||
except TimeoutError:
|
||||
# asyncio.TimeoutError is not the builtin TimeoutError before Python 3.11.
|
||||
except (TimeoutError, asyncio.TimeoutError):
|
||||
pass
|
||||
if cancelled_tail is not None and self.append_tail is cancelled_tail:
|
||||
self.append_tail = None
|
||||
|
||||
Reference in new issue
Block a user