provision: Fix version tuple generation logic.

Previous tuple generation logic was throwing an error parsing version like 3.6.7rc1
because micro-versions (like '7rc1') cannot be converted into an integer.

Fixes #482.
This commit is contained in:
Ujjwal Raizada 2018-11-01 05:02:56 +05:30 committed by Tim Abbott
parent 5c86679d5a
commit e769735108

View file

@ -36,7 +36,7 @@ the Python version this command is executed with."""
stderr=subprocess.STDOUT, universal_newlines=True)
# The output has the format "Python 1.2.3"
py_version_list = py_version_output.split()[1].split('.')
py_version = tuple(int(num) for num in py_version_list)
py_version = tuple(int(num) for num in py_version_list[0:2])
venv_name = 'zulip-api-py{}-venv'.format(py_version[0])
if py_version <= (3, 1) and (not options.force):