Commited the fix for get_version

This commit is contained in:
Oskar Hahn 2012-11-24 21:26:09 +01:00
parent 763da9233b
commit 3f469ab9d6

View File

@ -29,12 +29,11 @@ def get_version(version=None):
if version[3] != 'final': if version[3] != 'final':
if version[3] == 'dev': if version[3] == 'dev':
try: try:
import os
git_head_path = '.git/' + open('.git/HEAD', 'r').read()[5:].rstrip() git_head_path = '.git/' + open('.git/HEAD', 'r').read()[5:].rstrip()
git_commit_id = open(os.path.abspath(git_head_path), 'r').read().rstrip()
except IOError: except IOError:
git_commit_id = 'unknown' git_commit_id = 'unknown'
else:
import os
git_commit_id = open(os.path.abspath(git_head_path), 'r').read().rstrip()
sub = '-%s%s' % (version[3], git_commit_id) sub = '-%s%s' % (version[3], git_commit_id)
else: else:
sub = '-' + version[3] + str(version[4]) sub = '-' + version[3] + str(version[4])