Apparently different environments raise different return codes. Handle
the invalid return codes thrown by subprocess, presumably related to how
Travis checks out things from git.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: d3e9aee ("Don't catch non-Python 2.7 exceptions")
try:
git_version = subprocess.check_output(['git', 'describe'],
cwd=ROOT_DIR)
- except OSError:
+ except (OSError, subprocess.CalledProcessError):
return ''
return git_version.strip().decode('utf-8')