From 943de58826847173b4523927273c96792a7637f9 Mon Sep 17 00:00:00 2001 From: yanyongyu <42488585+yanyongyu@users.noreply.github.com> Date: Fri, 11 Feb 2022 11:25:31 +0800 Subject: [PATCH] :label: fix typing error --- nonebot/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nonebot/utils.py b/nonebot/utils.py index ca559684..e0900d12 100644 --- a/nonebot/utils.py +++ b/nonebot/utils.py @@ -22,6 +22,7 @@ from typing import ( Callable, Optional, Awaitable, + Coroutine, AsyncGenerator, ContextManager, ) @@ -99,7 +100,7 @@ def is_async_gen_callable(call: Callable[..., Any]) -> bool: return inspect.isasyncgenfunction(func_) -def run_sync(call: Callable[P, R]) -> Callable[P, Awaitable[R]]: +def run_sync(call: Callable[P, R]) -> Callable[P, Coroutine[None, None, R]]: """一个用于包装 sync function 为 async function 的装饰器 参数: