As described in https://docs.python.org/3/library/asyncio-eventloop.html , directly calling asyncio.get_event_loop() raises DeprecationWarning if no event loop is already running. The behavior of get_event_loop() was changed in Python 3.10.
Up to Python 3.9, get_event_loop() will silently create an event loop with no warnings.
It seems that in Python 3.10 and 3.11, get_event_loop() will still create an event loop, but a DeprecationWarning is raised.
The get_event_loop() behavior will change completely in Python 3.12, no longer creating an event loop but will raise an Error instead.
We must parse the code and ensure that get_event_loop() expecting an implicit event loop creation are removed from the code.
As described in https://docs.python.org/3/library/asyncio-eventloop.html , directly calling
asyncio.get_event_loop()
raises DeprecationWarning if no event loop is already running. The behavior ofget_event_loop()
was changed in Python 3.10.Up to Python 3.9,
get_event_loop()
will silently create an event loop with no warnings.It seems that in Python 3.10 and 3.11,
get_event_loop()
will still create an event loop, but a DeprecationWarning is raised.The
get_event_loop()
behavior will change completely in Python 3.12, no longer creating an event loop but will raise an Error instead.We must parse the code and ensure that
get_event_loop()
expecting an implicit event loop creation are removed from the code.