Commit a23b3c1a authored by Vitja Makarov's avatar Vitja Makarov

Add testcase for local variable deletion

parent 14b13e9c
......@@ -58,3 +58,17 @@ def try_finally(cond):
raise ValueError
finally:
return a
def deleted(cond):
"""
>>> deleted(False)
{}
>>> deleted(True)
Traceback (most recent call last):
...
UnboundLocalError: a
"""
a = {}
if cond:
del a
return a
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment