Skip to content

Commit 7194844

Browse files
dnicolodirgommers
authored andcommitted
BUG: output executed command line before command output
1 parent 3e18f93 commit 7194844

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mesonpy/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,10 @@ def __init__(
733733

734734
def _run(self, cmd: Sequence[str]) -> None:
735735
"""Invoke a subprocess."""
736-
print('{cyan}{bold}+ {}{reset}'.format(' '.join(cmd), **_STYLES))
736+
# Flush the line to ensure that the log line with the executed
737+
# command line appears before the command output. Without it,
738+
# the lines appear in the wrong order in pip output.
739+
print('{cyan}{bold}+ {}{reset}'.format(' '.join(cmd), **_STYLES), flush=True)
737740
r = subprocess.run(cmd, env=self._env, cwd=self._build_dir)
738741
if r.returncode != 0:
739742
raise SystemExit(r.returncode)

0 commit comments

Comments
 (0)