uvicorn icon indicating copy to clipboard operation
uvicorn copied to clipboard

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

Open graingert opened this issue 2 years ago • 2 comments

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

  • [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • [ ] I've updated the documentation accordingly.

graingert avatar Oct 14 '23 11:10 graingert

This still needs a doc change

graingert avatar Oct 15 '23 19:10 graingert

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

graingert avatar Oct 20 '23 12:10 graingert