mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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:
parent
face87c94e
commit
172c0f2752
16 changed files with 570 additions and 185 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue