Commit 634b45e
scripts: west_commands: patch: capture subprocess output in apply() method
Pass 'capture_output=True' to the 'subprocess.run()' call in the 'apply()'
method.
This ensures that stdout and stderr are captured, so 'proc.stderr'
is not 'None' when 'self.err()' is called on a failed process.
Example without this patch:
west patch apply --roll-back
error: patch failed: examples/csp_server_client.py:32
error: examples/csp_server_client.py: patch does not apply
ERROR: None
FATAL ERROR: failed to apply patch libcsp/test.patch
Example with this patch:
west patch apply --roll-back
ERROR: b'error: patch failed: examples/csp_server_client.py:32\n
error: examples/csp_server_client.py: patch does not apply\n'
FATAL ERROR: failed to apply patch libcsp/test.patch
Signed-off-by: Mirai SHINJO <oss@mshinjo.com>1 parent 5e650e7 commit 634b45e
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
0 commit comments