mirror of
https://github.com/davidhalter/parso.git
synced 2026-11-01 09:16:21 +08:00
Add no binding found for nonlocal issue
This commit is contained in:
1 parent
aa0225f63f
commit
0906c0b634
4 files changed
+49
-12
No files matched your search
@@ -47,13 +47,12 @@ except ZeroDivisionError:
|
||||
pass
|
||||
|
||||
|
||||
class X():
|
||||
nonlocal a
|
||||
|
||||
|
||||
def c():
|
||||
class X():
|
||||
nonlocal a
|
||||
a = 3
|
||||
|
||||
def d():
|
||||
class X():
|
||||
nonlocal a
|
||||
|
||||
|
||||
def x():
|
||||
|
||||
@@ -175,10 +175,30 @@ FAILING_EXAMPLES = [
|
||||
'''),
|
||||
dedent('''
|
||||
def x():
|
||||
global a
|
||||
nonlocal a
|
||||
a = 4
|
||||
def y():
|
||||
global a
|
||||
nonlocal a
|
||||
'''),
|
||||
# Missing binding of nonlocal
|
||||
dedent('''
|
||||
def x():
|
||||
nonlocal a
|
||||
'''),
|
||||
dedent('''
|
||||
def x():
|
||||
def y():
|
||||
nonlocal a
|
||||
'''),
|
||||
dedent('''
|
||||
def x():
|
||||
a = 4
|
||||
def y():
|
||||
global a
|
||||
print(a)
|
||||
def z():
|
||||
nonlocal a
|
||||
'''),
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user