浏览代码

fixed <3.9 compatibility

Rodja Trappe 3 年之前
父节点
当前提交
bb183727f9
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 0
      nicegui/elements/log.py
  2. 2 2
      nicegui/task_logger.py

+ 1 - 0
nicegui/elements/log.py

@@ -1,3 +1,4 @@
+from __future__ import annotations
 import asyncio
 import traceback
 import urllib

+ 2 - 2
nicegui/task_logger.py

@@ -1,6 +1,6 @@
 '''original copied from https://quantlane.com/blog/ensure-asyncio-task-exceptions-get-logged/'''
 
-from typing import Any, Awaitable, Optional, TypeVar
+from typing import Any, Awaitable, Optional, Tuple, TypeVar
 
 import asyncio
 import functools
@@ -40,7 +40,7 @@ def _handle_task_result(
     *,
     logger: logging.Logger,
     message: str,
-    message_args: tuple[Any, ...] = (),
+    message_args: Tuple[Any, ...] = (),
 ) -> None:
     try:
         task.result()