From 28c7cc6efebe60f13244f7f7e6281de39f59f39e Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Wed, 18 Feb 2026 15:49:52 -0800 Subject: [PATCH] style: move anyio import to module level per Greptile review --- litellm/proxy/proxy_server.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 8fa452fb40b..dd5af906f16 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -1,3 +1,4 @@ +import anyio import asyncio import copy import enum @@ -5147,8 +5148,6 @@ async def async_data_generator( # back to the connection pool. This prevents pool exhaustion when # clients disconnect mid-stream. # Shield from cancellation so the close awaits can complete. - import anyio - with anyio.CancelScope(shield=True): if hasattr(response, "aclose"): try: