================================================================
my_exec= 'my_exec'
my_exec2= 'my_exec2'
def jjj(x):
try: # - outer try catching my_exec
try: # - inner try catching my_exec2
jjk(x) # - raise my_exec but on a finally, raise my_exec2
except my_exec2, val:
print 'execption my_exec2 raised', val
print 'foul up if this is printed' # - if my_exec raised
except my_exec, val:
print 'execption my_exec raised', val
def jjk(x):
try:
raise my_exec, x
finally:
raise my_exec2, x+1
>>> jjj(3)
execption my_exec2 raised 4
foul up if this is printed
==================================================================
The raised my_exec exception which was first encountered is lost.
IMHO, it seems the implementation should raise this as a error. When
the my_exec exception is raised, the scope of the except clause for
my_exec2 should not be valid. It should be treated in this case as if
there is no error handler for the my_exec2 exception.
While the example may seem rather artificial, it can easily arise
in applications, so I think it is a serious error.
-- ========================================================= Mark Riggle | "Give me LAMBDA or sasmsr@unx.sas.com | give me death" SAS Institute Inc., | SAS Campus Drive, Cary, NC, 27513 | (919) 677-8000 |