build: fix up type hints for #430

This commit is contained in:
Gary Gale
2024-11-11 08:29:14 +00:00
parent f56a0646b0
commit d219b2f27c

View File

@@ -142,7 +142,7 @@ def cache(
# unintuitively, we have to await once here, so that caller
# does not have to await twice. See
# https://stackoverflow.com/a/59268198/532513
return await func(*args, **kwargs)
return await func(*args, **kwargs) # type: ignore[no-any-return]
else:
# sync, wrap in thread and return async
# see above why we have to await even although caller also awaits.
@@ -221,7 +221,7 @@ def cache(
return response
result = cast(R, coder.decode_as_type(cached, type_=return_type))
if isinstance(result, Response):
if response and isinstance(result, Response):
result.headers.update(response.headers)
return result