mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 03:57:00 +08:00
🏷️ fix typing error
This commit is contained in:
parent
c0af89a6ad
commit
943de58826
@ -22,6 +22,7 @@ from typing import (
|
|||||||
Callable,
|
Callable,
|
||||||
Optional,
|
Optional,
|
||||||
Awaitable,
|
Awaitable,
|
||||||
|
Coroutine,
|
||||||
AsyncGenerator,
|
AsyncGenerator,
|
||||||
ContextManager,
|
ContextManager,
|
||||||
)
|
)
|
||||||
@ -99,7 +100,7 @@ def is_async_gen_callable(call: Callable[..., Any]) -> bool:
|
|||||||
return inspect.isasyncgenfunction(func_)
|
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 的装饰器
|
"""一个用于包装 sync function 为 async function 的装饰器
|
||||||
|
|
||||||
参数:
|
参数:
|
||||||
|
Loading…
Reference in New Issue
Block a user