We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1ad8919 + 9039e6a commit 0016300Copy full SHA for 0016300
easybuild/tools/version.py
@@ -55,18 +55,18 @@ def get_git_revision():
55
relies on GitPython (see http://gitorious.org/git-python)
56
"""
57
try:
58
- import git
+ from git import Git, GitCommandError
59
except ImportError:
60
return UNKNOWN
61
62
path = os.path.dirname(__file__)
63
- gitrepo = git.Git(path)
+ gitrepo = Git(path)
64
res = gitrepo.rev_list('HEAD').splitlines()[0]
65
# 'encode' may be required to make sure a regular string is returned rather than a unicode string
66
# (only needed in Python 2; in Python 3, regular strings are already unicode)
67
if not isinstance(res, str):
68
res = res.encode('ascii')
69
- except git.GitCommandError:
+ except GitCommandError:
70
res = UNKNOWN
71
72
return res
0 commit comments