From 74b2c91b3b5d6dc6c9a15e627b888999b003b437 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Fri, 25 Nov 2022 14:49:43 -0500 Subject: [PATCH 1/2] Switch to active voice and suggest other edits "Preface" section of asyncio-eventloop.rst. As per #85747. --- Doc/library/asyncio-eventloop.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index d0a1ed2b99e55d..e9fb87787d4bb2 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -33,7 +33,8 @@ an event loop: Return the running event loop in the current OS thread. - If there is no running event loop a :exc:`RuntimeError` is raised. + Raise a :exc:`RuntimeError` if there is no running event loop. + This function can only be called from a coroutine or a callback. .. versionadded:: 3.7 @@ -52,17 +53,19 @@ an event loop: :func:`get_running_loop` function is preferred to :func:`get_event_loop` in coroutines and callbacks. - Consider also using the :func:`asyncio.run` function instead of using - lower level functions to manually create and close an event loop. + As noted above, consider using the higher-level :func:`asyncio.run` function, + instead of using these 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. - In future Python releases, this function will be an alias of - :func:`get_running_loop`. + Emits a deprecation warning if there is no running event loop. + In future Python releases, this function will become an alias of + :func:`get_running_loop` and will accordingly raise a + :exc:`RuntimeError` if there is no running event loop. .. function:: set_event_loop(loop) - Set *loop* as a current event loop for the current OS thread. + Set *loop* as the current event loop for the current OS thread. .. function:: new_event_loop() From 99b7da42270fb3df2e33e077d8be56b09f718891 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Fri, 2 Dec 2022 11:04:11 -0500 Subject: [PATCH 2/2] Switch 'will' to 'may', per discussion --- Doc/library/asyncio-eventloop.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index e9fb87787d4bb2..0bcaed5477fa91 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -59,7 +59,7 @@ an event loop: .. deprecated:: 3.10 Emits a deprecation warning if there is no running event loop. - In future Python releases, this function will become an alias of + In future Python releases, this function may become an alias of :func:`get_running_loop` and will accordingly raise a :exc:`RuntimeError` if there is no running event loop.