summaryrefslogtreecommitdiff
path: root/misc/tools/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'misc/tools/common.py')
-rw-r--r--misc/tools/common.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/misc/tools/common.py b/misc/tools/common.py
index 132558c2b..8f25f1989 100644
--- a/misc/tools/common.py
+++ b/misc/tools/common.py
@@ -43,11 +43,15 @@ def getGitHash():
try:
_gitHash = subprocess.check_output(
['git', '-C', BASEDIR, 'rev-parse', '--short', 'HEAD'],
- shell=False,
+ stderr=subprocess.STDOUT,
**_enc_kwargs
).strip()
except:
- pass
+ try:
+ # git rev-parse --short HEAD > githash.txt
+ _gitHash = readTextFile(pjoin(BASEDIR, 'githash.txt')).strip()
+ except:
+ pass
return _gitHash