Fix exception handling
This commit is contained in:
parent
835f9b4ba0
commit
9866b88faf
2 changed files with 17 additions and 15 deletions
|
|
@ -106,10 +106,14 @@ def parallel_map(
|
|||
unordered=unordered,
|
||||
ignore_exceptions=ignore_exceptions,
|
||||
)
|
||||
finally:
|
||||
should_stop.set()
|
||||
for p in processes:
|
||||
p.join()
|
||||
p.close()
|
||||
except:
|
||||
for p in processes:
|
||||
p.terminate()
|
||||
raise
|
||||
finally:
|
||||
input_queue.close()
|
||||
output_queue.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue