trap errors from git not being present

subprocess raises OSError if the command it is asked to run isn't found,
so trap that as well as the subprocess-specific error we were already
catching.

Change-Id: Ieb9c7f3ccc307250847104a7f97cfa28603fcf5d
Closes-Bug: #1521541
This commit is contained in:
Doug Hellmann 2015-12-01 16:34:54 +00:00
parent 23539cbb14
commit f8d71ac5ad
1 changed files with 2 additions and 1 deletions

View File

@ -26,7 +26,8 @@ def _guess_cgit_link():
git_remote = subprocess.check_output(
['git', 'config', '--local', '--get', 'remote.origin.url']
)
except subprocess.CalledProcessError:
except (OSError, subprocess.CalledProcessError):
# git is not present or the command failed
return None
else:
if six.PY3: