pyscript
pyscript copied to clipboard
"async with" statement fails without target variable assignment
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