Browse Source

run scripts/format.sh

pull/12066/head
Noah Klein 7 months ago
parent
commit
4cdc84db26
  1. 8
      fastapi/routing.py

8
fastapi/routing.py

@ -1,6 +1,7 @@
import asyncio
import dataclasses
import email.message
import functools
import inspect
import json
from contextlib import AsyncExitStack, asynccontextmanager
@ -20,10 +21,9 @@ from typing import (
Type,
Union,
)
import anyio
from anyio import CapacityLimiter
import functools
from fastapi import params
from fastapi._compat import (
ModelField,
@ -169,7 +169,9 @@ async def serialize_response(
# Run without a capacity limit for similar reasons as marked in fastapi/concurrency.py
exit_limiter = CapacityLimiter(1)
validate_func = functools.partial(field.validate, loc=("response",))
value, errors_ = await anyio.to_thread.run_sync(validate_func, response_content, {}, limiter=exit_limiter)
value, errors_ = await anyio.to_thread.run_sync(
validate_func, response_content, {}, limiter=exit_limiter
)
if isinstance(errors_, list):
errors.extend(errors_)
elif errors_:

Loading…
Cancel
Save