Exceptions: Difference between revisions

No change in size ,  15 years ago
Line 664:
{{works with|Python|2.5}}
 
try-except-finally-else-finally
 
<lang python>try:
Line 671:
print se.args
bar()
finally:
baz()
else:
# no exception occurred
quux()</lang>
finally:
baz()</lang>
 
Before Python 2.5 it was not possible to use finally and except together. (It was necessary to nest a separate ''try''...''except'' block inside of your ''try''...''finally'' block).
Line 686:
print(se.args)
bar()
finally:
baz()
else:
# no exception occurred
quux()</lang>
finally:
baz()</lang>
 
=={{header|Raven}}==
Anonymous user