Ignore stderr when doing the git revision check

(and use the older --git-dir instead of -C)
This commit is contained in:
mathieui 2015-01-21 14:18:19 +01:00
parent eb79322945
commit 992a460cf6
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3

View file

@ -29,8 +29,9 @@ git_dir = os.path.join(current_dir, '.git')
if os.path.exists(git_dir):
try:
import subprocess
result = subprocess.Popen(['git', '-C', git_dir, 'describe'],
result = subprocess.Popen(['git', '--git-dir', git_dir, 'describe'],
stdout=subprocess.PIPE)
stderr=subprocess.DEVNULL)
result.wait()
data = result.stdout.read().decode('utf-8', errors='ignore')
version = '.dev' + data.split('-')[1]