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:
parent
23539cbb14
commit
f8d71ac5ad
@ -26,7 +26,8 @@ def _guess_cgit_link():
|
|||||||
git_remote = subprocess.check_output(
|
git_remote = subprocess.check_output(
|
||||||
['git', 'config', '--local', '--get', 'remote.origin.url']
|
['git', 'config', '--local', '--get', 'remote.origin.url']
|
||||||
)
|
)
|
||||||
except subprocess.CalledProcessError:
|
except (OSError, subprocess.CalledProcessError):
|
||||||
|
# git is not present or the command failed
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
|
Loading…
Reference in New Issue
Block a user