Skip to content
Snippets Groups Projects
Unverified Commit 886fd393 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by Pablo Galindo
Browse files

gh-96706: [doc] Don't recomment deprecated use of get_event_loop() in examples (GH-96707)


(cherry picked from commit 53a54b78)

Co-authored-by: default avatarzhanpon <pon.zhan@gmail.com>
parent 040bbd2e
No related branches found
No related tags found
No related merge requests found
...@@ -1699,7 +1699,7 @@ event loop:: ...@@ -1699,7 +1699,7 @@ event loop::
print('Hello World') print('Hello World')
loop.stop() loop.stop()
loop = asyncio.get_event_loop() loop = asyncio.new_event_loop()
# Schedule a call to hello_world() # Schedule a call to hello_world()
loop.call_soon(hello_world, loop) loop.call_soon(hello_world, loop)
...@@ -1735,7 +1735,7 @@ after 5 seconds, and then stops the event loop:: ...@@ -1735,7 +1735,7 @@ after 5 seconds, and then stops the event loop::
else: else:
loop.stop() loop.stop()
loop = asyncio.get_event_loop() loop = asyncio.new_event_loop()
# Schedule the first call to display_date() # Schedule the first call to display_date()
end_time = loop.time() + 5.0 end_time = loop.time() + 5.0
...@@ -1767,7 +1767,7 @@ Wait until a file descriptor received some data using the ...@@ -1767,7 +1767,7 @@ Wait until a file descriptor received some data using the
# Create a pair of connected file descriptors # Create a pair of connected file descriptors
rsock, wsock = socketpair() rsock, wsock = socketpair()
loop = asyncio.get_event_loop() loop = asyncio.new_event_loop()
def reader(): def reader():
data = rsock.recv(100) data = rsock.recv(100)
......
...@@ -267,7 +267,7 @@ See also the main documentation section about the ...@@ -267,7 +267,7 @@ See also the main documentation section about the
.. rubric:: Examples .. rubric:: Examples
* :ref:`Using asyncio.get_event_loop() and loop.run_forever() * :ref:`Using asyncio.new_event_loop() and loop.run_forever()
<asyncio_example_lowlevel_helloworld>`. <asyncio_example_lowlevel_helloworld>`.
* :ref:`Using loop.call_later() <asyncio_example_call_later>`. * :ref:`Using loop.call_later() <asyncio_example_call_later>`.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment