From 17fd86be5774e78715254ad77a1df412c84b2a94 Mon Sep 17 00:00:00 2001 From: ipeluffo Date: Tue, 14 Apr 2026 12:07:43 +0100 Subject: [PATCH] Fix ruff linting issue --- fastapi/dependencies/models.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/fastapi/dependencies/models.py b/fastapi/dependencies/models.py index 2fbc96d92c..3cf73449b4 100644 --- a/fastapi/dependencies/models.py +++ b/fastapi/dependencies/models.py @@ -174,9 +174,11 @@ class Dependant: if self._is_gen_callable_cache is not None: return self._is_gen_callable_cache - dunder_unwrapped_call = getattr( - _unwrapped_call(self.call), "__call__", None - ) # noqa: B004 + dunder_unwrapped_call = getattr( # noqa: B004 + _unwrapped_call(self.call), + "__call__", + None, + ) if dunder_unwrapped_call is None: self._is_gen_callable_cache = False # pragma: no cover if inspect.isgeneratorfunction( @@ -214,9 +216,9 @@ class Dependant: if self._is_async_gen_callable_cache is not None: return self._is_async_gen_callable_cache - dunder_unwrapped_call = getattr( + dunder_unwrapped_call = getattr( # noqa: B004 _unwrapped_call(self.call), "__call__", None - ) # noqa: B004 + ) if dunder_unwrapped_call is None: self._is_async_gen_callable_cache = False # pragma: no cover elif inspect.isasyncgenfunction( @@ -258,9 +260,9 @@ class Dependant: if self._is_coroutine_callable_cache is not None: return self._is_coroutine_callable_cache - dunder_unwrapped_call = getattr( + dunder_unwrapped_call = getattr( # noqa: B004 _unwrapped_call(self.call), "__call__", None - ) # noqa: B004 + ) if dunder_unwrapped_call is None: self._is_coroutine_callable_cache = False # pragma: no cover elif iscoroutinefunction(