python3 compatibility on setup.py (fixes #28278)
This commit is contained in:
parent
000f683601
commit
44d24825c7
6
setup.py
6
setup.py
|
@ -54,7 +54,7 @@ class sdist(_sdist):
|
||||||
sub_commands = [('compile_translations', None)] + _sdist.sub_commands
|
sub_commands = [('compile_translations', None)] + _sdist.sub_commands
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
print "creating VERSION file"
|
print("creating VERSION file")
|
||||||
if os.path.exists('VERSION'):
|
if os.path.exists('VERSION'):
|
||||||
os.remove('VERSION')
|
os.remove('VERSION')
|
||||||
version = get_version()
|
version = get_version()
|
||||||
|
@ -62,7 +62,7 @@ class sdist(_sdist):
|
||||||
version_file.write(version)
|
version_file.write(version)
|
||||||
version_file.close()
|
version_file.close()
|
||||||
_sdist.run(self)
|
_sdist.run(self)
|
||||||
print "removing VERSION file"
|
print("removing VERSION file")
|
||||||
if os.path.exists('VERSION'):
|
if os.path.exists('VERSION'):
|
||||||
os.remove('VERSION')
|
os.remove('VERSION')
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ def get_version():
|
||||||
else:
|
else:
|
||||||
result = '0.0.0-%s' % len(subprocess.check_output(
|
result = '0.0.0-%s' % len(subprocess.check_output(
|
||||||
['git', 'rev-list', 'HEAD']).splitlines())
|
['git', 'rev-list', 'HEAD']).splitlines())
|
||||||
return result.replace('-', '.').replace('.g', '+g')
|
return result.decode('utf-8').replace('-', '.').replace('.g', '+g')
|
||||||
return '0.0.0'
|
return '0.0.0'
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue