print(f"I: {''.join(cmd_summary)}")
# Run the tool
- ret = subprocess.run(cmd, capture_output=True, timeout=10, encoding="UTF-8", env=env)
- if ret.returncode != 0:
- print(f"W: returned: {ret.returncode}:\n")
- print(textwrap.indent(ret.stdout, "W: "))
- print(textwrap.indent(ret.stderr, "W: "))
+ try:
+ subprocess.run(
+ cmd,
+ capture_output=True,
+ check=True,
+ timeout=180,
+ encoding="UTF-8",
+ env=env,
+ )
+ except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:
+ print(f"W: {e}:\n")
+ print(textwrap.indent(e.stdout, "W: "))
+ print(textwrap.indent(e.stderr, "W: "))
# PATH CONFIG FOR TOOL