B
Brian Alexander
Hello;
I'm curious to know how people preserve exceptions that arise in a try
... finally block. Consider this example:
try:
getResource()
doSomething()
finally:
alwaysFreeResource()
If an exception occurs in doSomething(), the resource is freed anyway --
which is good. How can I keep the exception 'raised' for another
try-finally/except to deal with? Does this problem reflect an error in
the way I am approaching the problem?
Many thanks,
Brian.
I'm curious to know how people preserve exceptions that arise in a try
... finally block. Consider this example:
try:
getResource()
doSomething()
finally:
alwaysFreeResource()
If an exception occurs in doSomething(), the resource is freed anyway --
which is good. How can I keep the exception 'raised' for another
try-finally/except to deal with? Does this problem reflect an error in
the way I am approaching the problem?
Many thanks,
Brian.