Commit 64fddaee authored by Felix Seibert's avatar Felix Seibert
Browse files

clarifying name, timeout in catch block

parent ba68860c
......@@ -87,22 +87,22 @@ def run_commands(commands, max_processes=200, print_errors=True):
del running_processes_map[finished_process]
# for finished_process in running_processes:
for finished_process in running_processes_map:
for still_running_process in running_processes_map:
try:
stdout, stderr = finished_process.communicate(timeout=10)
stdout, stderr = still_running_process.communicate(timeout=10)
except subprocess.TimeoutExpired:
print("process timed out: " + str(finished_process.args))
finished_process.kill()
print("process timed out: " + str(still_running_process.args))
still_running_process.kill()
print("process killed.")
stdout, stderr = finished_process.communicate()
stdout, stderr = still_running_process.communicate(timeout=10)
finished_process = (finished_process.args,
still_running_process = (still_running_process.args,
(stdout, stderr),
finished_process.returncode)
if finished_process[2] != 0:
errored_processes.append(finished_process)
still_running_process.returncode)
if still_running_process[2] != 0:
errored_processes.append(still_running_process)
if print_errors:
print_error(finished_process)
print_error(still_running_process)
num_finished += 1
print("progress: " + str(num_finished) + "/" + str(num_total))
......
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