Skip to content

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

Closed as not planned
@vstinner

Description

@vstinner

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions