Skip to content

Commit 59022c2

Browse files
committed
Mark async911.py as # NOCOMPILE for Python 3.10
Python 3.10's compile() rejects nested async comprehensions inside an async function with "asynchronous comprehension outside of an asynchronous function"; 3.11 became permissive here. The file parses fine with ast.parse on every supported version, which is all the plugin needs, so tag it with the existing # NOCOMPILE marker (also in the matching autofix fixture to keep the diff clean).
1 parent 4228b5c commit 59022c2

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

tests/autofix_files/async911.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# AUTOFIX
22
# ASYNCIO_NO_AUTOFIX
3+
# NOCOMPILE: contains a nested async comprehension inside an async function,
4+
# which is a SyntaxError under Python 3.10 (compile() got more permissive in 3.11).
5+
# ast.parse accepts it on all supported versions, which is all the plugin needs.
36
from typing import Any
47

58
import pytest

tests/eval_files/async911.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# AUTOFIX
22
# ASYNCIO_NO_AUTOFIX
3+
# NOCOMPILE: contains a nested async comprehension inside an async function,
4+
# which is a SyntaxError under Python 3.10 (compile() got more permissive in 3.11).
5+
# ast.parse accepts it on all supported versions, which is all the plugin needs.
36
from typing import Any
47

58
import pytest

0 commit comments

Comments
 (0)