setup: get version as a string

This commit is contained in:
Frédéric Péters 2018-04-25 11:13:20 +02:00
parent 9fb55c1a09
commit 474dfb46c8
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os
@ -34,7 +34,7 @@ def get_version():
p = subprocess.Popen(['git', 'describe', '--dirty', '--match=v*'], stdout=subprocess.PIPE)
result = p.communicate()[0]
if p.returncode == 0:
version = result.split()[0][1:]
version = str(result.split()[0][1:])
version = version.replace('-', '.')
return version
return '0'