Message145201
import random
from multiprocessing import Pool
from time import sleep
def Process(x):
try:
print x
sleep(random.random())
raise Exception('Exception: ' + x)
finally:
print 'Finally: ' + x
Pool(3).map(Process, ['1','2','3'])
Expect all three Finally blocks to be called (or at least, one Finally per x printed by line 8)
Actually, only one (occasionally two) are printed.
Same behaviour exhibited on dual-core Mac running OSX 10.6 with Python 2.7, and single core Ubuntu running Python 2.6. |
|
Date |
User |
Action |
Args |
2011-10-09 02:05:47 | daniel.wagner-hall | set | recipients:
+ daniel.wagner-hall |
2011-10-09 02:05:47 | daniel.wagner-hall | set | messageid: <1318125947.15.0.13973515193.issue13139@psf.upfronthosting.co.za> |
2011-10-09 02:05:46 | daniel.wagner-hall | link | issue13139 messages |
2011-10-09 02:05:46 | daniel.wagner-hall | create | |
|