From 0bb81c6a8d85dd47b1d67e93db36670631a034b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damien=20Nad=C3=A9?= Date: Sat, 25 Nov 2023 00:16:57 +0100 Subject: [PATCH] enforce callable type in __call__ return value --- kaioretry/decorator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kaioretry/decorator.py b/kaioretry/decorator.py index bc65601..827418a 100644 --- a/kaioretry/decorator.py +++ b/kaioretry/decorator.py @@ -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: