[TELE-596] add b prefix to string (trying to fix jenkins build error)

This commit is contained in:
Daniel Muyshond 2020-07-02 13:45:11 +02:00
parent 2c7c949b75
commit d1f2fb0ad8
1 changed files with 3 additions and 5 deletions

View File

@ -31,16 +31,14 @@ class eo_sdist(sdist):
def get_version():
if os.path.exists('VERSION'):
version_file = open('VERSION', 'r')
version = version_file.read()
version_file.close()
return version
with open('VERSION', 'r') as v:
return v.read()
if os.path.exists('.git'):
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 = version.replace('-', '.')
version = version.replace(b'-', b'.')
return version
return '0'