Skip to content
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

asyncio docs: Replace deprecated use of get_event_loop() with new_event_loop() #96706

Closed
zhanpon opened this issue Sep 9, 2022 · 0 comments
Closed
Labels
docs Documentation in the Doc dir topic-asyncio

Comments

@zhanpon
Copy link
Contributor

zhanpon commented Sep 9, 2022

In the asyncio's Event Loop document, some code examples will issue a DeprecationWarning when get_event_loop() is called:

$ python3 /tmp/hello.py
/tmp/hello.py:8: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()

The reason is explained in the manual of asyncio.get_event_loop:

Deprecated since version 3.10: Deprecation warning is emitted if there is no running event loop. In future Python releases, this function will be an alias of get_running_loop().

@zhanpon zhanpon added the docs Documentation in the Doc dir label Sep 9, 2022
zhanpon added a commit to zhanpon/cpython that referenced this issue Sep 9, 2022
zhanpon added a commit to zhanpon/cpython that referenced this issue Sep 9, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 11, 2022
…p() in examples (pythonGH-96707)

(cherry picked from commit 53a54b7)

Co-authored-by: zhanpon <pon.zhan@gmail.com>
miss-islington added a commit that referenced this issue Sep 13, 2022
… examples (GH-96707)

(cherry picked from commit 53a54b7)

Co-authored-by: zhanpon <pon.zhan@gmail.com>
pablogsal pushed a commit that referenced this issue Oct 22, 2022
… examples (GH-96707)

(cherry picked from commit 53a54b7)

Co-authored-by: zhanpon <pon.zhan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir topic-asyncio
Projects
Status: Done
Development

No branches or pull requests

3 participants