Skip to content

Commit 07d95a9

Browse files
committed
fix: it only takes coros
1 parent 2ea0021 commit 07d95a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/mega/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ def retry(
3939
min_delay: float = 2.0,
4040
max_delay: float = 30.0,
4141
backoff: int = 2,
42-
) -> Callable[[Callable[_P, _R]], Callable[_P, Coroutine[None, None, _R]]]:
42+
) -> Callable[[Callable[_P, Coroutine[None, None, _R]]], Callable[_P, Coroutine[None, None, _R]]]:
4343
if not isinstance(exceptions, Sequence):
4444
exceptions = [exceptions]
4545

46-
def wrapper(func: Callable[_P, _R]) -> Callable[_P, Coroutine[None, None, _R]]:
46+
def wrapper(func: Callable[_P, Coroutine[None, None, _R]]) -> Callable[_P, Coroutine[None, None, _R]]:
4747
@wraps(func)
4848
async def inner_wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _R:
4949
current_delay = delay
5050
for attempt in range(1, attempts + 1):
5151
try:
52-
return func(*args, **kwargs)
52+
return await func(*args, **kwargs)
5353
except tuple(exceptions) as exc:
5454
if attempt >= attempts:
5555
raise

0 commit comments

Comments
 (0)