diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-04-02 12:00:47 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-04-10 15:27:08 +0300 |
commit | 4de2f265070089b59f4151e8ebba5fa463002ed5 (patch) | |
tree | 7380aa63847865cfb99578293d873da20b1e5eaf | |
parent | 94d337a1592431b64e41e9938fdf020163bb9b67 (diff) | |
download | subplot-4de2f265070089b59f4151e8ebba5fa463002ed5.tar.gz |
fix: check capturing stderr of cargo, mixing it with stdout
When ./check runs a command, in the runcmd_unchecked method, it
collects by default stdout and stderr into on string. The two outputs
get mixed. So far, this has been OK, but I'm about to make change
where it won't be OK. The get_template method needs to be able to
distinguish between stdout and stderr, when I change Subplot to write
warnings into stderr.
Sponsored-by: author
-rwxr-xr-x | check | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -58,8 +58,10 @@ class Runcmd: self.msg(f"RUN: {argv} {kwargs}") if not self._verbose: - kwargs["stdout"] = PIPE - kwargs["stderr"] = STDOUT + if "stdout" not in kwargs: + kwargs["stdout"] = PIPE + if "stderr" not in kwargs: + kwargs["stderr"] = STDOUT assert "key" not in kwargs env = dict(os.environ) @@ -179,6 +181,7 @@ class Runcmd: filename, ], stdout=PIPE, + stderr=PIPE, ).stdout.decode("UTF-8") metadata = json.loads(metadata) impls = metadata.get("impls", {}) |