瀏覽代碼

#445 add back CancelledError handling

Falko Schindler 2 年之前
父節點
當前提交
54f2d3d5f1
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      nicegui/background_tasks.py

+ 2 - 0
nicegui/background_tasks.py

@@ -49,5 +49,7 @@ def create_lazy(coroutine: Awaitable[T], *, name: str) -> 'asyncio.Task[T]':
 def _handle_task_result(task: asyncio.Task) -> None:
     try:
         task.result()
+    except asyncio.CancelledError:
+        pass
     except Exception as e:
         globals.handle_exception(e)