Browse Source

Fix ruff linting issue

pull/15336/head
ipeluffo 3 months ago
parent
commit
17fd86be57
Failed to extract signature
  1. 16
      fastapi/dependencies/models.py

16
fastapi/dependencies/models.py

@ -174,9 +174,11 @@ class Dependant:
if self._is_gen_callable_cache is not None: if self._is_gen_callable_cache is not None:
return self._is_gen_callable_cache return self._is_gen_callable_cache
dunder_unwrapped_call = getattr( dunder_unwrapped_call = getattr( # noqa: B004
_unwrapped_call(self.call), "__call__", None _unwrapped_call(self.call),
) # noqa: B004 "__call__",
None,
)
if dunder_unwrapped_call is None: if dunder_unwrapped_call is None:
self._is_gen_callable_cache = False # pragma: no cover self._is_gen_callable_cache = False # pragma: no cover
if inspect.isgeneratorfunction( if inspect.isgeneratorfunction(
@ -214,9 +216,9 @@ class Dependant:
if self._is_async_gen_callable_cache is not None: if self._is_async_gen_callable_cache is not None:
return self._is_async_gen_callable_cache return self._is_async_gen_callable_cache
dunder_unwrapped_call = getattr( dunder_unwrapped_call = getattr( # noqa: B004
_unwrapped_call(self.call), "__call__", None _unwrapped_call(self.call), "__call__", None
) # noqa: B004 )
if dunder_unwrapped_call is None: if dunder_unwrapped_call is None:
self._is_async_gen_callable_cache = False # pragma: no cover self._is_async_gen_callable_cache = False # pragma: no cover
elif inspect.isasyncgenfunction( elif inspect.isasyncgenfunction(
@ -258,9 +260,9 @@ class Dependant:
if self._is_coroutine_callable_cache is not None: if self._is_coroutine_callable_cache is not None:
return self._is_coroutine_callable_cache return self._is_coroutine_callable_cache
dunder_unwrapped_call = getattr( dunder_unwrapped_call = getattr( # noqa: B004
_unwrapped_call(self.call), "__call__", None _unwrapped_call(self.call), "__call__", None
) # noqa: B004 )
if dunder_unwrapped_call is None: if dunder_unwrapped_call is None:
self._is_coroutine_callable_cache = False # pragma: no cover self._is_coroutine_callable_cache = False # pragma: no cover
elif iscoroutinefunction( elif iscoroutinefunction(

Loading…
Cancel
Save