proxy fixes

This commit is contained in:
Harshit Jain 2026-02-11 12:13:47 +00:00
parent aba32d9929
commit 61e2f5fbd3

View file

@ -307,7 +307,12 @@ class ProxyInitializationHelpers:
"""Helper function to determine the event loop type based on platform"""
if sys.platform in ("win32", "cygwin", "cli"):
return None # Let uvicorn choose the default loop on Windows
return "uvloop"
try:
import uvloop # noqa: F401
return "uvloop"
except ImportError:
return None # Fall back to default asyncio loop (e.g. Python 3.14 where uvloop is unavailable)
@click.command()