Commit d93ebf0f authored by Kevin Modzelewski's avatar Kevin Modzelewski

Running into a codegen bug related to unpacking-inside-try-handlers

parent d5322423
# expected: fail
# - we currently can't even compile this correctly
#
# The unpacking should be atomic: ie either all of the names get set or none of them do.
# We currently assume that unpacking can only throw an exception from the tuple being the
# wrong length, but instead we should be emulating the UNPACK_SEQUENCE bytecode.
class C(object):
def __getitem__(self, i):
print "__getitem__", i
if i == 0:
return 1
raise IndexError
def __len__(self):
print "len"
return 2
def f():
try:
x, y = C()
except ValueError:
pass
try:
print x
except NameError, e:
print e
try:
print y
except NameError, e:
print e
f()
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