issue #477: Python 2.4 lacked str.partition.

This commit is contained in:
David Wilson 2019-01-23 12:44:08 +00:00
parent 2ec19f2374
commit 2ead451277
1 changed files with 11 additions and 9 deletions

View File

@ -348,16 +348,18 @@ def get_docker_host():
class DockerizedSshDaemon(object):
distro, _, _py3 = (
os.environ.get('MITOGEN_TEST_DISTRO', 'debian')
.partition('-')
)
mitogen_test_distro = os.environ.get('MITOGEN_TEST_DISTRO', 'debian')
if '-' in mitogen_test_distro:
distro, _py3 = mitogen_test_distro.split('-')
else:
distro = mitogen_test_distro
_py3 = None
if _py3 == 'py3':
python_path = '/usr/bin/python3'
else:
python_path = '/usr/bin/python'
python_path = (
'/usr/bin/python3'
if _py3 == 'py3'
else '/usr/bin/python'
)
image = 'mitogen/%s-test' % (distro,)
# 22/tcp -> 0.0.0.0:32771