gh-93453: No longer create an event loop in get_event_loop() by serhiy-storchaka · Pull Request #98440 · python/cpython
asyncio.get_event_loop() now always return either running event loop or the result of get_event_loop_policy().get_event_loop() call. The latter should now raise an RuntimeError if no current event loop was set instead of creating and setting a new event loop. It affects also a number of asyncio functions and constructors which call get_event_loop() implicitly: ensure_future(), shield(), gather(), etc. DeprecationWarning is no longer emitted if there is no running event loop but the current event loop was set.
ambv
mentioned this pull request
amotl
mentioned this pull request
p-gentili pushed a commit to canonical/yarf that referenced this pull request
…ction (#256) The sync check_connection entrypoints in the Mir and Vnc platforms called asyncio.get_event_loop() to obtain (or implicitly create) an event loop. Since CPython PR python/cpython#98440 (Python 3.12), that call no longer auto-creates a loop once anything in the process has touched the loop policy and raises RuntimeError instead. With the recent pytest-asyncio 1.x and pytest 9 bumps, xdist workers no longer incidentally have a loop pre-installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters