forked from Rust-related/RustPython
Add test for nonlocal
This commit is contained in:
@@ -56,6 +56,14 @@ c = 2
|
||||
with assertRaises(SyntaxError):
|
||||
exec(src)
|
||||
|
||||
# Invalid syntax:
|
||||
src = """
|
||||
def a():
|
||||
nonlocal a
|
||||
"""
|
||||
|
||||
with assertRaises(SyntaxError):
|
||||
exec(src)
|
||||
|
||||
# class X:
|
||||
# nonlocal c
|
||||
|
||||
Reference in New Issue
Block a user