From 19c3792af57ddf4eacf50161714247b1aa775325 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sun, 31 Dec 2017 09:50:34 -0500 Subject: [PATCH] tools/provision: Exit earlier for python2. We really want to avoid confusing folks that just want to work on bots in python3. --- tools/provision | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/provision b/tools/provision index 0f5218f..66349d8 100755 --- a/tools/provision +++ b/tools/provision @@ -40,6 +40,12 @@ the Python version this command is executed with.""" py_version = tuple(int(num) for num in py_version_list) venv_name = 'zulip-api-py{}-venv'.format(py_version[0]) + if py_version <= (3, 1) and (not options.force): + print(red + "Provision failed: Cannot create venv with outdated Python version ({}).\n" + "Run this script with --force if you want to proceed anyway." + .format(py_version_output.strip()) + end_format) + sys.exit(1) + venv_dir = os.path.join(base_dir, venv_name) if not os.path.isdir(venv_dir): try: @@ -88,11 +94,6 @@ the Python version this command is executed with.""" install_dependencies('requirements.txt') if py_version > (3, 1): install_dependencies('py3_requirements.txt') - elif not options.force: - print(red + "Provision failed: Cannot create venv with outdated Python version ({}).\n" - "Run this script with --force if you want to proceed anyway." - .format(py_version_output.strip()) + end_format) - sys.exit(1) print(green + 'Success!' + end_format)