From 7f5e6db63d058c974f1ea4ba2eaadc1a95463a00 Mon Sep 17 00:00:00 2001 From: Bastien Orivel Date: Mon, 3 Jun 2019 22:02:52 +0200 Subject: [PATCH] Check for python's version in mach On archlinux, python 2 isn't installed by default and it leads to some really confusing error messages when running mach --- mach | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mach b/mach index f56c94c96aa..c92653e1af8 100755 --- a/mach +++ b/mach @@ -15,6 +15,13 @@ from __future__ import print_function, unicode_literals import os import sys +# Check for the current python version as some users (especially on archlinux) +# may not have python 2 installed and their /bin/python binary symlinked to +# python 3. +if sys.version_info >= (3, 0): + print("mach does not support python 3, please install python 2") + sys.exit(1) + def main(args): topdir = os.path.abspath(os.path.dirname(sys.argv[0]))