From d1f2fb0ad8abb5928df4327658c914c031535e40 Mon Sep 17 00:00:00 2001 From: Daniel Muyshond Date: Thu, 2 Jul 2020 13:45:11 +0200 Subject: [PATCH] [TELE-596] add b prefix to string (trying to fix jenkins build error) --- setup.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 8c5df3d..b47338f 100644 --- a/setup.py +++ b/setup.py @@ -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'