pylance-release icon indicating copy to clipboard operation
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

Open lromanov opened this issue 5 years ago • 3 comments

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

image

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.

lromanov avatar Aug 13 '21 11:08 lromanov

Thanks for the bug report. I've confirmed this is a bug, and I'll work on a fix.

erictraut avatar Aug 13 '21 15:08 erictraut

This will be fixed in the next release.

erictraut avatar Aug 20 '21 04:08 erictraut

the fix is in 2021.8.3 release.

heejaechang avatar Aug 25 '21 22:08 heejaechang