mirror of
https://github.com/davidhalter/parso.git
synced 2026-02-06 01:47:58 +08:00
Prevent incorrect syntax error with nonlocal of a parameter
Also includes a test for the error "name 'x' is assigned before nonlocal declaration" Fixes #175
This commit is contained in:
@@ -337,6 +337,13 @@ FAILING_EXAMPLES = [
|
||||
def z():
|
||||
nonlocal a
|
||||
'''),
|
||||
# Name is assigned before nonlocal declaration
|
||||
dedent('''
|
||||
def x(a):
|
||||
def y():
|
||||
a = 10
|
||||
nonlocal a
|
||||
'''),
|
||||
]
|
||||
|
||||
if sys.version_info[:2] >= (3, 7):
|
||||
|
||||
Reference in New Issue
Block a user