Skip to content

Commit 036296f

Browse files
committed
Fix reported type of decorator
1 parent a3401ae commit 036296f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

meilisearch/errors.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import json
44
from functools import wraps
5-
from typing import TYPE_CHECKING, Any, Callable
5+
from typing import TYPE_CHECKING, Any, Callable, TypeVar
66

77
from requests import Response
88

@@ -11,6 +11,8 @@
1111
from meilisearch.index import Index
1212
from meilisearch.task import TaskHandler
1313

14+
T = TypeVar("T")
15+
1416

1517
class MeilisearchError(Exception): # pragma: no cover
1618
"""Generic class for Meilisearch error handling"""
@@ -63,7 +65,7 @@ def __str__(self) -> str: # pragma: no cover
6365
return f"MeilisearchTimeoutError, {self.message}"
6466

6567

66-
def version_error_hint_message(func: Callable) -> Any:
68+
def version_error_hint_message(func: Callable[..., T]) -> Callable[..., T]:
6769
@wraps(func)
6870
def wrapper(*args: Any, **kwargs: Any) -> Any:
6971
try:

0 commit comments

Comments
 (0)