Skip to content

"async with" statement fails without target variable assignment  #581

Closed
@dmamelin

Description

@dmamelin

This code causes an error: RuntimeError: Lock is not acquired.

lock = asyncio.Lock()
async with lock:
    pass

Workaround:

lock = asyncio.Lock()
async with lock as lock_test:
    pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions