8000 gh-96706: [doc] Don't recomment deprecated use of get_event_loop() in… · python/cpython@886fd39 · GitHub
[go: up one dir, main page]

Skip to content

Commit 886fd39

Browse files
miss-islingtonzhanpon
authored andcommitted
gh-96706: [doc] Don't recomment deprecated use of get_event_loop() in examples (GH-96707)
(cherry picked from commit 53a54b7) Co-authored-by: zhanpon <pon.zhan@gmail.com>
1 parent 040bbd2 commit 886fd39

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Doc/library/asyncio-eventloop.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ event loop::
16991699
print('Hello World')
17001700
loop.stop()
17011701

1702-
loop = asyncio.get_event_loop()
1702+
loop = asyncio.new_event_loop()
17031703

17041704
# Schedule a call to hello_world()
17051705
loop.call_soon(hello_world, loop)
@@ -1735,7 +1735,7 @@ after 5 seconds, and then stops the event loop::
17351735
else:
17361736
loop.stop()
17371737

1738-
loop = asyncio.get_event_loop()
1738+
loop = asyncio.new_event_loop()
17391739

17401740
# Schedule the first call to display_date()
17411741
end_time = loop.time() + 5.0
@@ -1767,7 +1767,7 @@ Wait until a file descriptor received some data using the
17671767
# Create a pair of connected file descriptors
17681768
rsock, wsock = socketpair()
17691769

1770-
loop = asyncio.get_event_loop()
1770+
loop = asyncio.new_event_loop()
17711771

17721772
def reader():
17731773
data = rsock.recv(100)

Doc/library/asyncio-llapi-index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ See also the main documentation section about the
267267

268268
.. rubric:: Examples
269269

270-
* :ref:`Using asyncio.get_event_loop() and loop.run_forever()
270+
* :ref:`Using asyncio.new_event_loop() and loop.run_forever()
271271
<asyncio_example_lowlevel_helloworld>`.
272272

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

0 commit comments

Comments
 (0)
0