Closed encukou closed 2 years ago
I can confirm this actually works.
Thanks @encukou.
Maybe we could also get rid of asyncio.get_event_loop(), which is deprecated since Python 3.10. It will become an alias to asyncio.get_running_loop()
, and this code will break.
OK, here's a bigger change: all the code that needs the loop moved to an async
function, run by asyncio.run
.
This makes several loop
arguments unused, but I don't know if something depends on it being there, so I didn't remove it.
Is it OK to drop compatibility with Python 3.6?
Yes it is, do you also want to update setup.py
?
Thanks a lot @encukou!
Passing coroutines directly to asyncio.wait is deprecated since Python 3.8, as it leads to confusing behavior.
In Python 3.11,
wait()
will no longer accept coroutines and must be given Tasks.