micropython: add micropython component
This commit is contained in:
19
components/language/micropython/tests/basics/unboundlocal.py
Normal file
19
components/language/micropython/tests/basics/unboundlocal.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# locals referenced before assignment
|
||||
|
||||
def f1():
|
||||
print(x)
|
||||
x = 1
|
||||
|
||||
def f2():
|
||||
for i in range(0):
|
||||
print(i)
|
||||
print(i)
|
||||
|
||||
def check(f):
|
||||
try:
|
||||
f()
|
||||
except NameError:
|
||||
print("NameError")
|
||||
|
||||
check(f1)
|
||||
check(f2)
|
Reference in New Issue
Block a user