I was wondering why Python 3.3 kills the exception because of return
in try/finally
statement, take a look at this code:
import sys
def action1():
try:
action2()
finally:
return # try/finally doesn't kill exceptions
# But with return, exceptions not propagated
def action2():
raise Exception()
try:
action1()
except Exception as e:
print("except clause")
Is this behavior desirable and where can we apply its usage?