diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 0f3a9f968268a..8e0992fd8bfd5 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -19,6 +19,8 @@ except ImportError: lzma = None +assert sys.version_info.major == 3 + if sys.platform == 'win32': EXE_SUFFIX = ".exe" else: diff --git a/x.py b/x.py index 5dee953a31899..53ebecbbbabd7 100755 --- a/x.py +++ b/x.py @@ -19,7 +19,9 @@ os.execvp("python3", ["python3"] + sys.argv) except OSError: # Python 3 isn't available, fall back to python 2 - pass + sys.stderr.write("Could not find Python 3. If you have Python 3 available, use it to invoke x.py.") + sys.stderr.write("If no Python 3 is available, consider installing it: https://www.python.org/downloads/") + exit(1) rust_dir = os.path.dirname(os.path.abspath(__file__)) # For the import below, have Python search in src/bootstrap first.