diff options
author | Doug Hellmann <doug@doughellmann.com> | 2015-12-01 16:34:54 +0000 |
---|---|---|
committer | Doug Hellmann <doug@doughellmann.com> | 2015-12-01 16:34:54 +0000 |
commit | f8d71ac5ad023a32cbbe04e109eb2793433ee558 (patch) | |
tree | 39a2921195d542c980c8af967b4ce2c81c7fbc13 | |
parent | 23539cbb14c1258f24f0c2c9928e5235bdbb419c (diff) | |
download | oslosphinx-f8d71ac5ad023a32cbbe04e109eb2793433ee558.tar.gz |
trap errors from git not being present4.1.0
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
-rw-r--r-- | oslosphinx/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/oslosphinx/__init__.py b/oslosphinx/__init__.py index 7f311c8..239eed4 100644 --- a/oslosphinx/__init__.py +++ b/oslosphinx/__init__.py @@ -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: |