pylance-release
pylance-release copied to clipboard
Erroneous flagging of parentheses in "with (await ...)" statement in Python 3.6, 3.7 and 3.8; valid parentheses are flagged
Environment data
- Language Server version: Pylance 2021.8.1
- OS and version: macOS Big Sur
- Python version (& distribution if applicable, e.g. Anaconda): 3.6.11
Expected behaviour
No red underlining; this is valid code in Python 3.6
Actual behaviour

Logs
No logs
Code Snippet / Additional information
import asyncio
async def main():
with (await asyncio.Lock()):
print('exit')
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
Similar bug has been fixed in #999, but async/await case is still here.
Thanks for the bug report. I've confirmed this is a bug, and I'll work on a fix.
This will be fixed in the next release.
the fix is in 2021.8.3 release.