From 0b05e5511c25d9406ff07ea60c29c73ab74a24e6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 13:26:49 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/dependencies/utils.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index c3d892726..ef01d16b0 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -216,7 +216,11 @@ def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature: name=param.name, kind=param.kind, default=param.default, - annotation=get_typed_annotation(param.annotation, globalns, getattr(call_frame, "f_locals", {}),), + annotation=get_typed_annotation( + param.annotation, + globalns, + getattr(call_frame, "f_locals", {}), + ), ) for param in signature.parameters.values() ] @@ -235,7 +239,9 @@ def get_first_outer_frame() -> Optional[FrameType]: return None -def get_typed_annotation(annotation: Any, globalns: Dict[str, Any], localns: Dict[str, Any]) -> Any: +def get_typed_annotation( + annotation: Any, globalns: Dict[str, Any], localns: Dict[str, Any] +) -> Any: if isinstance(annotation, str): annotation = ForwardRef(annotation) annotation = evaluate_forwardref(annotation, globalns, localns) @@ -251,7 +257,11 @@ def get_typed_return_annotation(call: Callable[..., Any]) -> Any: return None globalns = getattr(call, "__globals__", {}) - return get_typed_annotation(annotation, globalns, getattr(call_frame, "f_locals", {}),) + return get_typed_annotation( + annotation, + globalns, + getattr(call_frame, "f_locals", {}), + ) def get_dependant(