[AIRFLOW-1938] Clean up unused exception

There is no longer the possibility of a
GitCommandError (since cc4404b5f7)

Closes #2898 from wrp/setup
This commit is contained in:
William Pursell 2017-12-22 13:49:37 +01:00 коммит произвёл Bolke de Bruin
Родитель 6645218092
Коммит a5ca8cdce9
1 изменённых файлов: 2 добавлений и 7 удалений

Просмотреть файл

@ -72,19 +72,14 @@ def git_version(version):
logger.warning('gitpython not found: Cannot compute the git version.')
return ''
except Exception as e:
logger.warning('Git repo not found: Cannot compute the git version.')
logger.warning('Cannot compute the git version. {}'.format(e))
return ''
if repo:
sha = repo.head.commit.hexsha
if repo.is_dirty():
return '.dev0+{sha}.dirty'.format(sha=sha)
# commit is clean
# is it release of `version` ?
try:
return '.release:{version}+{sha}'.format(version=version,
sha=sha)
except git.GitCommandError:
return '.dev0+{sha}'.format(sha=sha)
return '.release:{version}+{sha}'.format(version=version, sha=sha)
else:
return 'no_git_version'