Skip to content

Commit

Permalink
enforce callable type in __call__ return value
Browse files Browse the repository at this point in the history
  • Loading branch information
Anvil committed Nov 24, 2023
1 parent bd6fed0 commit 0bb81c6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kaioretry/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ def is_func_async(cls, func: Function) -> bool:
def __call__(self, func: Callable[FuncParam, FuncRetVal]) \
-> Callable[FuncParam, FuncRetVal]:
if self.is_func_async(func):
return self.aioretry(
cast(Callable[FuncParam, Awaitable[Any]], func))
return cast(Callable[FuncParam, FuncRetVal], self.aioretry(func))
return self.retry(func)

def __str__(self) -> str:
Expand Down

0 comments on commit 0bb81c6

Please sign in to comment.