encode / uvicorn

An ASGI web server, for Python. 🦄
https://www.uvicorn.org/
BSD 3-Clause "New" or "Revised" License
8.57k stars 745 forks source link

use asyncio.run(..., loop_factory) to avoid asyncio.set_event_loop_policy #2130

Open graingert opened 1 year ago

graingert commented 1 year ago

Summary

set_event_loop_policy will be deprecated in python 3.13 and uvloop.EventLoopPolicy is deprecated already, this backports and uses the preferred loop_factory keyword to configure asyncio.run

Checklist

graingert commented 1 year ago

This still needs a doc change

graingert commented 1 year ago

actually this doesn't need a doc change as --loop never allowed a custom loop setup function