python3 compatibility on setup.py (fixes #28278)

This commit is contained in:
Paul Marillonnet 2018-11-23 12:16:05 +01:00 committed by Benjamin Dauvergne
parent 000f683601
commit 44d24825c7
1 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ class sdist(_sdist):
sub_commands = [('compile_translations', None)] + _sdist.sub_commands
def run(self):
print "creating VERSION file"
print("creating VERSION file")
if os.path.exists('VERSION'):
os.remove('VERSION')
version = get_version()
@ -62,7 +62,7 @@ class sdist(_sdist):
version_file.write(version)
version_file.close()
_sdist.run(self)
print "removing VERSION file"
print("removing VERSION file")
if os.path.exists('VERSION'):
os.remove('VERSION')
@ -89,7 +89,7 @@ def get_version():
else:
result = '0.0.0-%s' % len(subprocess.check_output(
['git', 'rev-list', 'HEAD']).splitlines())
return result.replace('-', '.').replace('.g', '+g')
return result.decode('utf-8').replace('-', '.').replace('.g', '+g')
return '0.0.0'