Commit fd7dc3d9 authored by Felix Seibert's avatar Felix Seibert
Browse files

fixing changed set during iteration

parent 590952f2
......@@ -41,12 +41,14 @@ def run_commands(commands, max_processes=200):
running_processes.add(started_process)
if len(running_processes) >= max_processes:
os.wait()
difference = set()
for running_process in running_processes:
if running_process.poll() is not None:
finished_processes.append((running_process.args,
difference.add((running_process.args,
running_process.communicate(),
running_process.returncode))
running_processes.remove(running_process)
running_processes = running_processes.difference(difference)
for p in running_processes:
p.wait()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment