Skip to content

Commit c91fdad

Browse files
authored
🐛 Lint: 修复 async 函数返回值 (#3364)
1 parent dc42a6a commit c91fdad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nonebot/drivers/websockets.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
description: nonebot.drivers.websockets 模块
1818
"""
1919

20-
from collections.abc import AsyncGenerator, Coroutine
20+
from collections.abc import AsyncGenerator
2121
from contextlib import asynccontextmanager
2222
from functools import wraps
2323
import logging
24+
from types import CoroutineType
2425
from typing import TYPE_CHECKING, Any, Callable, TypeVar, Union
2526
from typing_extensions import ParamSpec, override
2627

@@ -47,8 +48,8 @@
4748

4849

4950
def catch_closed(
50-
func: Callable[P, Coroutine[Any, Any, T]],
51-
) -> Callable[P, Coroutine[Any, Any, T]]:
51+
func: Callable[P, "CoroutineType[Any, Any, T]"],
52+
) -> Callable[P, "CoroutineType[Any, Any, T]"]:
5253
@wraps(func)
5354
async def decorator(*args: P.args, **kwargs: P.kwargs) -> T:
5455
try:

0 commit comments

Comments
 (0)