bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() (GH-23554)

asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop.
In future releases it will became an alias of asyncio.get_running_loop().
This commit is contained in:
Serhiy Storchaka 2021-04-25 13:40:44 +03:00 committed by GitHub
parent face87c94e
commit 172c0f2752
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 570 additions and 185 deletions

View file

@ -53,6 +53,11 @@ an event loop:
Consider also using the :func:`asyncio.run` function instead of using
lower level functions to manually create and close an event loop.
.. deprecated:: 3.10
Deprecation warning is emitted if there is no running event loop.
If future Python releases this function will be an alias of
:func:`get_running_loop`.
.. function:: set_event_loop(loop)
Set *loop* as a current event loop for the current OS thread.