Message260210
If you add the "if __name__ == '__main__':" guard after defining the target function, as specified in the multiprocessing doc, you will get a traceback much as you expect:
Traceback (most recent call last):
File "F:\Python\mypy\tem.py", line 12, in <module>
for new_val in pool.imap(add_one, value_iter):
File "C:\Programs\Python35\lib\multiprocessing\pool.py", line 695, in next
raise value
File "C:\Programs\Python35\lib\multiprocessing\pool.py", line 380, in _handle_tasks
for i, task in enumerate(taskseq):
File "C:\Programs\Python35\lib\multiprocessing\pool.py", line 286, in <genexpr>
self._taskqueue.put((((result._job, i, func, (x,), {})
File "F:\Python\mypy\tem.py", line 10, in <genexpr>
value_iter = (int(v) for v in values)
ValueError: invalid literal for int() with base 10: 'foo'
I have seem this bug of omission multiple times on Stackoverflow. |
|
Date |
User |
Action |
Args |
2016-02-12 23:16:53 | terry.reedy | set | recipients:
+ terry.reedy, jnoller, sbt, davin, Aaron Halfaker |
2016-02-12 23:16:53 | terry.reedy | set | messageid: <1455319013.63.0.382743574906.issue26333@psf.upfronthosting.co.za> |
2016-02-12 23:16:53 | terry.reedy | link | issue26333 messages |
2016-02-12 23:16:53 | terry.reedy | create | |
|