summaryrefslogtreecommitdiff
path: root/doc/bst2html.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/bst2html.py')
-rwxr-xr-xdoc/bst2html.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/bst2html.py b/doc/bst2html.py
index b3204b8d8..cfaf05513 100755
--- a/doc/bst2html.py
+++ b/doc/bst2html.py
@@ -218,8 +218,11 @@ def run_bst_command(config_file, directory, command):
click.echo("Running bst command in directory '{}': bst {}".format(directory, command), err=True)
argv = ['python3', '-m', 'buildstream', '--colors', '--config', config_file] + shlex.split(command)
- p = subprocess.Popen(argv, cwd=directory, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- out, _ = p.communicate()
+ try:
+ out = subprocess.check_output(argv, cwd=directory, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ click.echo("Command failed:\n{}".format(e.output.decode('utf-8').strip()))
+ sys.exit(1)
return out.decode('utf-8').strip()