Fixed hanging scripts trying to parse stderr

code.py, specifically, was getting messed up by inconsequential GCC
objdump errors on Clang -g3 generated binaries.

Now stderr from child processes is just redirected to /dev/null when
-v/--verbose is not provided.

If we actually depended on redirecting stderr->stdout these scripts
would have been broken when -v/--verbose was provided anyways. Not
really sure what the original code was trying to do...
This commit is contained in:
Christopher Haster
2024-06-12 14:31:57 -05:00
parent 79175e8846
commit a735bcd667
8 changed files with 22 additions and 22 deletions

View File

@@ -227,7 +227,7 @@ def collect(gcda_paths, *,
print(' '.join(shlex.quote(c) for c in cmd))
proc = sp.Popen(cmd,
stdout=sp.PIPE,
stderr=sp.PIPE if not args.get('verbose') else None,
stderr=None if args.get('verbose') else sp.DEVNULL,
universal_newlines=True,
errors='replace',
close_fds=False)