diff --git a/build.rs b/build.rs index 27e134bf5e..c94c77b7fa 100644 --- a/build.rs +++ b/build.rs @@ -679,7 +679,13 @@ fn gn() -> String { * variable or defaulting to `python3`. */ fn python() -> String { - env::var("PYTHON").unwrap_or_else(|_| "python3".to_owned()) + env::var("PYTHON").unwrap_or_else(|_| { + if cfg!(target_os = "windows") { + "python".to_owned() + } else { + "python3".to_owned() + } + }) } type NinjaEnv = Vec<(String, String)>;