diff options
Diffstat (limited to 'bitbake/lib/bb/process.py')
-rw-r--r-- | bitbake/lib/bb/process.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/bb/process.py b/bitbake/lib/bb/process.py index 7c3995cce5..4c7b6d39df 100644 --- a/bitbake/lib/bb/process.py +++ b/bitbake/lib/bb/process.py | |||
@@ -1,4 +1,6 @@ | |||
1 | # | 1 | # |
2 | # Copyright BitBake Contributors | ||
3 | # | ||
2 | # SPDX-License-Identifier: GPL-2.0-only | 4 | # SPDX-License-Identifier: GPL-2.0-only |
3 | # | 5 | # |
4 | 6 | ||
@@ -60,7 +62,7 @@ class Popen(subprocess.Popen): | |||
60 | "close_fds": True, | 62 | "close_fds": True, |
61 | "preexec_fn": subprocess_setup, | 63 | "preexec_fn": subprocess_setup, |
62 | "stdout": subprocess.PIPE, | 64 | "stdout": subprocess.PIPE, |
63 | "stderr": subprocess.STDOUT, | 65 | "stderr": subprocess.PIPE, |
64 | "stdin": subprocess.PIPE, | 66 | "stdin": subprocess.PIPE, |
65 | "shell": False, | 67 | "shell": False, |
66 | } | 68 | } |
@@ -142,7 +144,7 @@ def _logged_communicate(pipe, log, input, extrafiles): | |||
142 | while pipe.poll() is None: | 144 | while pipe.poll() is None: |
143 | read_all_pipes(log, rin, outdata, errdata) | 145 | read_all_pipes(log, rin, outdata, errdata) |
144 | 146 | ||
145 | # Pocess closed, drain all pipes... | 147 | # Process closed, drain all pipes... |
146 | read_all_pipes(log, rin, outdata, errdata) | 148 | read_all_pipes(log, rin, outdata, errdata) |
147 | finally: | 149 | finally: |
148 | log.flush() | 150 | log.flush() |
@@ -181,5 +183,8 @@ def run(cmd, input=None, log=None, extrafiles=None, **options): | |||
181 | stderr = stderr.decode("utf-8") | 183 | stderr = stderr.decode("utf-8") |
182 | 184 | ||
183 | if pipe.returncode != 0: | 185 | if pipe.returncode != 0: |
186 | if log: | ||
187 | # Don't duplicate the output in the exception if logging it | ||
188 | raise ExecutionError(cmd, pipe.returncode, None, None) | ||
184 | raise ExecutionError(cmd, pipe.returncode, stdout, stderr) | 189 | raise ExecutionError(cmd, pipe.returncode, stdout, stderr) |
185 | return stdout, stderr | 190 | return stdout, stderr |