Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (14 sloc) 272 Bytes
class Error(Exception):
def foo():
for i in reversed(range(10)):
if i == 5:
raise Error
yield i
i = 0
for (i, val) in enumerate(foo()):
print i
except Error:
print "caught exception at i = %d" % i
Something went wrong with that request. Please try again.