My understanding is that finally clauses must *always* be executed if the try has been entered.
import random
finally
re-raises the original exception unless you return from it. The exception is then raised by Pool.map
and kills your entire application. The subprocesses are terminated and you see no other exceptions.
You can add a return
to swallow the exception:
def Process(x):
try:
print x
sleep(random.random())
raise Exception('Exception: ' + x)
finally:
print 'Finally: ' + x
return
Then you should have None
in your map
result when an exception occurred.