py/makeversionhdr.py: Fallback to using docs version if no git repo.

Addresses issue #1420.
modjni
Damien George 2015-08-11 12:27:38 +01:00
parent 7027fd5343
commit 0d5d16074f
1 changed files with 5 additions and 2 deletions

View File

@ -21,8 +21,11 @@ def get_version_info_from_git():
# Note: git describe doesn't work if no tag is available
try:
git_tag = subprocess.check_output(["git", "describe", "--dirty", "--always"], universal_newlines=True).strip()
except subprocess.CalledProcessError:
git_tag = subprocess.check_output(["git", "describe", "--dirty", "--always"], stderr=subprocess.STDOUT, universal_newlines=True).strip()
except subprocess.CalledProcessError as er:
if er.args[0] == 128:
# git exit code of 128 means no repository found
return None
git_tag = ""
except OSError:
return None