Use iscoroutinefunction from inspect instead of asyncio on 3.12+

This commit is contained in:
Jakub Kuczys
2026-04-14 14:46:19 -04:00
committed by GitHub
parent 85144ec5e4
commit 3270121c80
12 changed files with 59 additions and 44 deletions
+1 -2
View File
@@ -25,7 +25,6 @@ DEALINGS IN THE SOFTWARE.
from __future__ import annotations
import datetime
import inspect
import itertools
from operator import attrgetter
from typing import Any, Awaitable, Callable, Collection, Dict, List, Optional, TYPE_CHECKING, Tuple, TypeVar, Union
@@ -190,7 +189,7 @@ def flatten_user(cls: T) -> T:
# probably a member function by now
def generate_function(x):
# We want sphinx to properly show coroutine functions as coroutines
if inspect.iscoroutinefunction(value):
if utils._iscoroutinefunction(value):
async def general(self, *args, **kwargs): # type: ignore
return await getattr(self._user, x)(*args, **kwargs)