From c1691f5d94f3f7a97bcd4bec34c7522db105c25d Mon Sep 17 00:00:00 2001 From: Lucas Wiman Date: Fri, 24 Jun 2022 11:06:08 -0700 Subject: [PATCH] mypy complains about this code since Callable does not have a .__wrapped__ attribute. It is guarded by a hasattr check, so it is safe to ignore this error. --- fastapi/dependencies/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index 08ea969a4..948f5800d 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -250,7 +250,7 @@ def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature: # The __wrapped__ attribute is set by decorators, e.g. functools.wraps. # This while loop allows rereferencing forward references on decorated # methods. - nsobj = nsobj.__wrapped__ + nsobj = nsobj.__wrapped__ # type: ignore globalns = getattr(nsobj, "__globals__", {}) typed_params = [ inspect.Parameter(