misc: python 3 compatibility (#12805)
This commit is contained in:
parent
34bbb37ab4
commit
054e0a8922
6
setup.py
6
setup.py
|
@ -20,7 +20,7 @@ from setuptools import setup, find_packages
|
||||||
class eo_sdist(sdist):
|
class eo_sdist(sdist):
|
||||||
|
|
||||||
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()
|
||||||
|
@ -28,7 +28,7 @@ class eo_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')
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ def get_version():
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
result = p.communicate()[0]
|
result = p.communicate()[0]
|
||||||
if p.returncode == 0:
|
if p.returncode == 0:
|
||||||
return result.split()[0][1:].replace('-', '.')
|
return result.decode('ascii').split()[0][1:].replace('-', '.')
|
||||||
else:
|
else:
|
||||||
return '0.0.0-%s' % len(
|
return '0.0.0-%s' % len(
|
||||||
subprocess.check_output(
|
subprocess.check_output(
|
||||||
|
|
Loading…
Reference in New Issue