Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
@@ -1663,7 +1663,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)
@@ -1699,7 +1699,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
@@ -1731,7 +1731,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)
2 changes: 1 addition & 1 deletion Doc/library/asyncio-llapi-index.rst
Original file line number Diff line number Diff line change
@@ -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>`.