circuitpython/tests/basics/del_local.py
Damien George 539681fffd tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore.

Addresses issue #727.
2014-07-05 06:14:29 +01:00

26 lines
377 B
Python

# delete local then try to reference it
def f():
x = 1
y = 2
print(x, y)
del x
print(y)
try:
print(x)
except NameError:
print("NameError");
f()
# delete local then try to delete it again
def g():
x = 3
y = 4
print(x, y)
del x
print(y)
try:
del x
except NameError:
print("NameError");
g()