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.get_event_loop() fails if there is no current event loop #94174

Closed
vstinner opened this issue Jun 23, 2022 · 4 comments
Closed

asyncio.get_event_loop() fails if there is no current event loop #94174

vstinner opened this issue Jun 23, 2022 · 4 comments
Labels
topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

In Python 3.10, asyncio.get_event_loop() was modified to emit a DeprecationWarning if there is no current event loop. I propose to convert this deprecation into an exception. This change is part of issue #83710 plan.

What's New In Python 3.10:

asyncio.get_event_loop() now emits a deprecation warning if there is no running event loop. In the future it will be an alias of get_running_loop(). asyncio functions which implicitly create Future or Task objects now emit a deprecation warning if there is no running event loop and no explicit loop argument is passed: ensure_future(), wrap_future(), gather(), shield(), as_completed() and constructors of Future, Task, StreamReader, StreamReaderProtocol. (Contributed by Serhiy Storchaka in bpo-39529.)

I'm working on a PR to implement this change.

@serhiy-storchaka
Copy link
Member

Isn't it a duplicate of #93453?

@kumaraditya303
Copy link
Contributor

Duplicate of #93453

@kumaraditya303 kumaraditya303 marked this as a duplicate of #93453 Oct 16, 2022
@kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
@kumaraditya303
Copy link
Contributor

See discussion on #93453

@vstinner
Copy link
Member Author

vstinner commented Nov 4, 2022

Isn't it a duplicate of #93453?

Right. I close my issue and my PR: #94175 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-asyncio type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

4 participants