Skip to content

Commit

Permalink
gh-96706: [doc] Don't recomment deprecated use of get_event_loop() in…
Browse files Browse the repository at this point in the history
… examples (GH-96707)

(cherry picked from commit 53a54b7)

Co-authored-by: zhanpon <pon.zhan@gmail.com>
  • Loading branch information
2 people authored and pablogsal committed Oct 22, 2022
1 parent 040bbd2 commit 886fd39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,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)
Expand Down Expand Up @@ -1735,7 +1735,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
Expand Down Expand Up @@ -1767,7 +1767,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)
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/asyncio-llapi-index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
<asyncio_example_lowlevel_helloworld>`.

* :ref:`Using loop.call_later() <asyncio_example_call_later>`.
Expand Down

0 comments on commit 886fd39

Please sign in to comment.