Message280146
I have the following code:
from multiprocessing import Pool
def double(x):
return 2 * x
def get_numbers():
raise Exception("oops")
yield 1
yield 2
print(list(Pool(processes=2).imap(double, get_numbers())))
I would expect it to raise an exception, but instead it just prints "[]", seeming to indicate that imap ran fine and produced no values.
This seems similar to the behavior described in bugs 23051 and 26333, but this happens if the iterator directly raises an exception before yielding anything. If I move the raise statement below one or both of the yields, I get an exception from imap as expected.
I am experiencing this with Python 3.5.2 on OS X 10.11.6. I haven't tried it with any other versions. |
|
Date |
User |
Action |
Args |
2016-11-06 16:16:43 | elias | set | recipients:
+ elias |
2016-11-06 16:16:43 | elias | set | messageid: <1478449003.58.0.0873174644967.issue28625@psf.upfronthosting.co.za> |
2016-11-06 16:16:43 | elias | link | issue28625 messages |
2016-11-06 16:16:43 | elias | create | |
|