Browse Source

try to satisfy linter

pull/11895/head
Alexander 'Leo' Bergolth 1 year ago
parent
commit
3d47a2c5e7
  1. 1
      fastapi/concurrency.py
  2. 4
      fastapi/param_functions.py
  3. 4
      fastapi/params.py

1
fastapi/concurrency.py

@ -11,7 +11,6 @@ else: # pragma: no cover
import anyio
from anyio import CapacityLimiter
from starlette.concurrency import iterate_in_threadpool as iterate_in_threadpool # noqa
from starlette.concurrency import run_in_threadpool as run_in_threadpool # noqa
from starlette.concurrency import ( # noqa
run_until_first_complete as run_until_first_complete,
)

4
fastapi/param_functions.py

@ -2246,7 +2246,7 @@ def Depends( # noqa: N802
),
] = True,
limiter: Annotated[
anyio.CapacityLimiter,
Optional[anyio.CapacityLimiter],
Doc(
"""
By default, synchronous dependencies will be run in a threadpool
@ -2337,7 +2337,7 @@ def Security( # noqa: N802
),
] = True,
limiter: Annotated[
anyio.CapacityLimiter,
Optional[anyio.CapacityLimiter],
Doc(
"""
By default, synchronous dependencies will be run in a threadpool

4
fastapi/params.py

@ -763,7 +763,7 @@ class Depends:
def __init__(
self, dependency: Optional[Callable[..., Any]] = None, *,
use_cache: bool = True,
limiter: anyio.CapacityLimiter | None = None,
limiter: Optional[anyio.CapacityLimiter] = None,
):
self.dependency = dependency
self.use_cache = use_cache
@ -784,7 +784,7 @@ class Security(Depends):
*,
scopes: Optional[Sequence[str]] = None,
use_cache: bool = True,
limiter: anyio.CapacityLimiter | None = None,
limiter: Optional[anyio.CapacityLimiter] = None,
):
super().__init__(dependency=dependency, use_cache=use_cache, limiter=limiter)
self.scopes = scopes or []

Loading…
Cancel
Save