diff options
author | Jack Lloyd <[email protected]> | 2018-01-29 05:19:47 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-01-29 05:19:47 -0500 |
commit | 65ab80df80333acedf7f8c7dfc16b3da0daa6bd9 (patch) | |
tree | b338898d1e75ec451f21c32e7c7eb0b41c3c1bd3 /src/scripts | |
parent | bb02b60dae96361818ac362d13ac69243d655387 (diff) |
Catch exceptions from subprocess in build_docs [ci skip]
If eg binary file not found, this just crashed with no useful diagnostic.
Diffstat (limited to 'src/scripts')
-rwxr-xr-x | src/scripts/build_docs.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/scripts/build_docs.py b/src/scripts/build_docs.py index da36b5348..df99ba9c3 100755 --- a/src/scripts/build_docs.py +++ b/src/scripts/build_docs.py @@ -54,13 +54,19 @@ def run_and_check(cmd_line, cwd=None): logging.debug("Executing %s", ' '.join(cmd_line)) - proc = subprocess.Popen(cmd_line, - close_fds=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - cwd=cwd) + stdout = None + stderr = None - (stdout, stderr) = proc.communicate() + try: + proc = subprocess.Popen(cmd_line, + close_fds=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=cwd) + + (stdout, stderr) = proc.communicate() + except OSError as e: + logging.error("Executing %s failed (%s)", ' '.join(cmd_line), e) if stdout: logging.debug(stdout.decode()) |