mirror of
https://github.com/micropython/micropython.git
synced 2025-09-05 17:30:41 +02:00
A simple reproducer is: async for x in (): x Before this change, it would cause an assertion error in mpy-cross and micropython-coverage.
20 lines
312 B
Python
20 lines
312 B
Python
# test syntax errors using async
|
|
|
|
try:
|
|
exec
|
|
except NameError:
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
|
|
def test_syntax(code):
|
|
try:
|
|
exec(code)
|
|
print("no SyntaxError")
|
|
except SyntaxError:
|
|
print("SyntaxError")
|
|
|
|
|
|
test_syntax("async for x in (): x")
|
|
test_syntax("async with x: x")
|