mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
17 lines
205 B
Python
17 lines
205 B
Python
|
|
|
|
src = """
|
|
def valid_func():
|
|
pass
|
|
|
|
yield 2
|
|
"""
|
|
|
|
try:
|
|
compile(src, 'test.py', 'exec')
|
|
except SyntaxError as ex:
|
|
assert ex.lineno == 5
|
|
else:
|
|
raise AssertionError("Must throw syntax error")
|
|
|