Skip to content

Commit

Permalink
Update feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerivec committed Oct 29, 2024
1 parent 5f26b02 commit ca40896
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tools/build_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,14 @@ def load_toolchains(paths: list[pathlib.Path]) -> dict[pathlib.Path, str]:


def subprocess_run_verbose(command: list[str], prefix: str) -> None:
result = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

with result.stdout:
for line in iter(result.stdout.readline, b""):
with subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
) as proc:
for line in proc.stdout:
LOGGER.info("[%s] %r", prefix, line.decode("utf-8").strip())

result_returncode = result.wait()

if result_returncode != 0:
LOGGER.error("[%s] Error: %s", prefix, result_returncode)
if proc.returncode != 0:
LOGGER.error("[%s] Error: %s", prefix, proc.returncode)
sys.exit(1)


Expand Down

0 comments on commit ca40896

Please sign in to comment.