Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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