mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Python: Fix some more async parsing problems
Turns out we were not setting the `is_async` field on anything except `async for` statements. This commit makes it so that we also do this for `async def` and `async with`, and adds a test that this produces the same behaviour as the old parser.
This commit is contained in:
8
python/extractor/tests/parser/async-await.py
Normal file
8
python/extractor/tests/parser/async-await.py
Normal file
@@ -0,0 +1,8 @@
|
||||
async def foo():
|
||||
await bar() + await baz()
|
||||
|
||||
async with foo() as bar, baz() as quux:
|
||||
pass
|
||||
|
||||
async for spam in eggs:
|
||||
pass
|
||||
Reference in New Issue
Block a user