From 3f469ab9d60d06045a706d5140c106c4a85c4ada Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Sat, 24 Nov 2012 21:26:09 +0100 Subject: [PATCH] Commited the fix for get_version --- openslides/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openslides/__init__.py b/openslides/__init__.py index a9fc81a12..93ec6dc61 100644 --- a/openslides/__init__.py +++ b/openslides/__init__.py @@ -29,12 +29,11 @@ def get_version(version=None): if version[3] != 'final': if version[3] == 'dev': try: + import os 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: 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) else: sub = '-' + version[3] + str(version[4])