From 343d3a21850cf277abeb0d946933e9e98bd87d0b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 16:34:42 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/applications.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/fastapi/applications.py b/fastapi/applications.py index 9324ea33f..915f5f70a 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -1019,10 +1019,8 @@ class FastAPI(Starlette): # streaming responses while keeping compatibility with the previous # versions (as of writing 0.117.1) that allowed doing # except HTTPException inside a dependency with yield. - # This needs to happen after user middlewares because those create a # new contextvars context copy by using a new AnyIO task group. - # This AsyncExitStack preserves the context for contextvars, not # strictly necessary for closing files but it was one of the original # intentions. @@ -1030,7 +1028,6 @@ class FastAPI(Starlette): # contextvars were set, for example in a dependency with 'yield' # in that internal contextvars context, the values would not be # available in the outer context of the AsyncExitStack. - # By placing the middleware and the AsyncExitStack here, inside all # user middlewares, the same context is used. # This is currently not needed, only for closing files, but used to be