File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
22import dataclasses
3- import inspect # noqa: F401
3+ import inspect
44import sys
55from asyncio .coroutines import _is_coroutine # type: ignore[attr-defined]
66from functools import _CacheInfo , _make_key , partial , partialmethod
2828else :
2929 from typing_extensions import Self
3030
31- if sys .version_info >= (3 , 14 ):
32- iscoroutinefunction = inspect .iscoroutinefunction
33- else :
34- iscoroutinefunction = asyncio .iscoroutinefunction
35-
3631
3732__version__ = "2.0.4"
3833
@@ -299,13 +294,14 @@ def _make_wrapper(
299294 typed : bool ,
300295 ttl : Optional [float ] = None ,
301296) -> Callable [[_CBP [_R ]], _LRUCacheWrapper [_R ]]:
297+ @inspect .markcoroutinefunction
302298 def wrapper (fn : _CBP [_R ]) -> _LRUCacheWrapper [_R ]:
303299 origin = fn
304300
305301 while isinstance (origin , (partial , partialmethod )):
306302 origin = origin .func
307303
308- if not iscoroutinefunction (origin ):
304+ if not inspect . iscoroutinefunction (origin ):
309305 raise RuntimeError (f"Coroutine function is required, got { fn !r} " )
310306
311307 # functools.partialmethod support
You can’t perform that action at this time.
0 commit comments