From 4cdc84db264b072d6aa7bf25cc4a4ccf28a25be8 Mon Sep 17 00:00:00 2001 From: Noah Klein Date: Sat, 24 Aug 2024 22:52:16 +0000 Subject: [PATCH] run scripts/format.sh --- fastapi/routing.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index a78bfc0bc..fe37eb548 100644 --- a/fastapi/routing.py +++ b/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_: