Davin Potts added the comment:

To tie in the example given by @elias in issue28625, this inconsistency in 
behavior is not limited to ThreadPool -- it appears with a process Pool as well:


from multiprocessing import Pool


def double(x):
    return 2 * x

def get_numbers():
    raise Exception("oops")
    yield 1
    yield 2


>>> list(Pool(processes=2).imap(double, get_numbers()))  # returns list
[]
>>> list(Pool(processes=2).map(double, get_numbers()))
Traceback (most recent call last):
  ...
Exception: oops


def get_numbers_differently():
    yield 1
    raise Exception("oops")
    yield 2


>>> list(Pool(processes=2).imap(double, get_numbers_differently()))  # now we 
>>> see exception
Traceback (most recent call last):
  ...
Exception: oops

----------
assignee:  -> davin
nosy: +elias
stage:  -> needs patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28699>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to