adapt setup.py for python3 compatibility

This commit is contained in:
Frédéric Péters 2018-03-26 09:30:50 +02:00
parent c2f059e7aa
commit 2ee8b2e5fd
1 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,7 @@ class TestCommand(distutils.core.Command):
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()
@ -54,7 +54,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')
@ -72,7 +72,7 @@ def get_version():
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
result = p.communicate()[0] result = p.communicate()[0]
if p.returncode == 0: if p.returncode == 0:
version = result.split()[0][1:] version = str(result.split()[0][1:])
version = version.replace('-', '.') version = version.replace('-', '.')
return version return version
return '0.0.0' return '0.0.0'
@ -83,7 +83,7 @@ setuptools.setup(
license='GPLv3 or later', license='GPLv3 or later',
description='Common API to use all French online payment credit card ' description='Common API to use all French online payment credit card '
'processing services', 'processing services',
long_description=file( long_description=open(
os.path.join( os.path.join(
os.path.dirname(__file__), os.path.dirname(__file__),
'README.txt')).read(), 'README.txt')).read(),