Fix another small issue with global/nonlocal names.

This commit is contained in:
Dave Halter
2017-07-30 12:55:58 +02:00
parent 2420f57a5c
commit 443cb1ce08
2 changed files with 16 additions and 6 deletions

View File

@@ -202,16 +202,25 @@ def test_indentation_errors(code, positions):
def glob():
global x
x: foo = 3
'''),
'''),
# global/nonlocal + param
dedent('''
def glob(x):
global x
'''),
'''),
dedent('''
def glob(x):
nonlocal x
'''),
'''),
dedent('''
def x():
a =3
def z():
nonlocal a
a = 3
nonlocal a
'''),
# IndentationError
' foo',