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