about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--config.toml.example3
-rw-r--r--src/bootstrap/sanity.rs2
2 files changed, 4 insertions, 1 deletions
diff --git a/config.toml.example b/config.toml.example
index f45db37c33b..b4ad15a8235 100644
--- a/config.toml.example
+++ b/config.toml.example
@@ -162,6 +162,9 @@
 # Python interpreter to use for various tasks throughout the build, notably
 # rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
 # Note that Python 2 is currently required.
+#
+# Defaults to python2.7, then python2. If neither executable can be found, then
+# it defaults to the Python interpreter used to execute x.py.
 #python = "python2.7"
 
 # Force Cargo to check that Cargo.lock describes the precise dependency
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index 1a26309b471..b9f456e9100 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -109,9 +109,9 @@ pub fn check(build: &mut Build) {
     }
 
     build.config.python = build.config.python.take().map(|p| cmd_finder.must_have(p))
-        .or_else(|| env::var_os("BOOTSTRAP_PYTHON").map(PathBuf::from)) // set by bootstrap.py
         .or_else(|| cmd_finder.maybe_have("python2.7"))
         .or_else(|| cmd_finder.maybe_have("python2"))
+        .or_else(|| env::var_os("BOOTSTRAP_PYTHON").map(PathBuf::from)) // set by bootstrap.py
         .or_else(|| Some(cmd_finder.must_have("python")));
 
     build.config.nodejs = build.config.nodejs.take().map(|p| cmd_finder.must_have(p))