Explorar o código

#445 add back CancelledError handling

Falko Schindler %!s(int64=2) %!d(string=hai) anos
pai
achega
54f2d3d5f1
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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)