@@ -33,7 +33,8 @@ an event loop:
33
33
34
34
Return the running event loop in the current OS thread.
35
35
36
- If there is no running event loop a :exc: `RuntimeError ` is raised.
36
+ Raise a :exc: `RuntimeError ` if there is no running event loop.
37
+
37
38
This function can only be called from a coroutine or a callback.
38
39
39
40
.. versionadded :: 3.7
@@ -52,17 +53,19 @@ an event loop:
52
53
:func: `get_running_loop ` function is preferred to :func: `get_event_loop `
53
54
in coroutines and callbacks.
54
55
55
- Consider also using the :func: `asyncio.run ` function instead of using
56
- lower level functions to manually create and close an event loop.
56
+ As noted above, consider using the higher-level :func: `asyncio.run ` function,
57
+ instead of using these lower level functions to manually create and close an
58
+ event loop.
57
59
58
60
.. deprecated :: 3.10
59
- Deprecation warning is emitted if there is no running event loop.
60
- In future Python releases, this function will be an alias of
61
- :func: `get_running_loop `.
61
+ Emits a deprecation warning if there is no running event loop.
62
+ In future Python releases, this function may become an alias of
63
+ :func: `get_running_loop ` and will accordingly raise a
64
+ :exc: `RuntimeError ` if there is no running event loop.
62
65
63
66
.. function :: set_event_loop(loop)
64
67
65
- Set *loop * as a current event loop for the current OS thread.
68
+ Set *loop * as the current event loop for the current OS thread.
66
69
67
70
.. function :: new_event_loop()
68
71
0 commit comments