From 6f8c077fa5349d445358b879fc83c139a0c22cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Fri, 9 Apr 2021 20:23:24 +0200 Subject: [PATCH] Fix eachdist.py not printing invoked commands. (#1758) I observed the following pattern: ``` >>> cmd1 >>> cmd2 ``` The `>>> cmd` header should come immediately before the command output to facilitate debugging & progress reporting. --- scripts/eachdist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/eachdist.py b/scripts/eachdist.py index a939f0d93df..7a305a34e0f 100755 --- a/scripts/eachdist.py +++ b/scripts/eachdist.py @@ -343,7 +343,7 @@ def runsubprocess(dry_run, params, *args, **kwargs): check = kwargs.pop("check") # Enforce specifying check - print(">>>", cmdstr, file=sys.stderr) + print(">>>", cmdstr, file=sys.stderr, flush=True) # This is a workaround for subprocess.run(['python']) leaving the virtualenv on Win32. # The cause for this is that when running the python.exe in a virtualenv, @@ -356,7 +356,7 @@ def runsubprocess(dry_run, params, *args, **kwargs): # Only this would find the "correct" python.exe. params = list(params) - executable = shutil.which(params[0]) # On Win32, pytho + executable = shutil.which(params[0]) if executable: params[0] = executable try: