From 53a54b781d1f05f2d0b40ce88b3da92d5d23e9d2 Mon Sep 17 00:00:00 2001 From: zhanpon Date: Mon, 12 Sep 2022 04:56:30 +0900 Subject: [PATCH] gh-96706: [doc] Don't recomment deprecated use of get_event_loop() in examples (#96707) --- Doc/library/asyncio-eventloop.rst | 6 +++--- Doc/library/asyncio-llapi-index.rst | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index c86da8c31f6e7a..ef0f6fc8e68cd4 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -1675,7 +1675,7 @@ event loop:: print('Hello World') loop.stop() - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() # Schedule a call to hello_world() loop.call_soon(hello_world, loop) @@ -1711,7 +1711,7 @@ after 5 seconds, and then stops the event loop:: else: loop.stop() - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() # Schedule the first call to display_date() end_time = loop.time() + 5.0 @@ -1743,7 +1743,7 @@ Wait until a file descriptor received some data using the # Create a pair of connected file descriptors rsock, wsock = socketpair() - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() def reader(): data = rsock.recv(100) diff --git a/Doc/library/asyncio-llapi-index.rst b/Doc/library/asyncio-llapi-index.rst index cdadb7975ad494..3cec4c69f86ea7 100644 --- a/Doc/library/asyncio-llapi-index.rst +++ b/Doc/library/asyncio-llapi-index.rst @@ -267,7 +267,7 @@ See also the main documentation section about the .. rubric:: Examples -* :ref:`Using asyncio.get_event_loop() and loop.run_forever() +* :ref:`Using asyncio.new_event_loop() and loop.run_forever() `. * :ref:`Using loop.call_later() `.