From 4b1c48831ab41c93986c2c7367003c8000e1ce00 Mon Sep 17 00:00:00 2001 From: namuyan Date: Sat, 12 Oct 2019 13:13:28 +0900 Subject: [PATCH] catch stdout(others) and stderr(windows) output --- build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 48526d40..33a14947 100644 --- a/build.rs +++ b/build.rs @@ -29,9 +29,9 @@ lazy_static! { .iter() .map(|bin| (bin, Command::new(bin).arg("--version").output())) .filter(|(_, r)| r.is_ok()) - .map(|(bin, r)| (bin, r.unwrap().stderr)) + .map(|(bin, r)| (bin, r.unwrap())) // begin with `Python 3.X.X :: additional info` - .find(|(_, r)| r.starts_with(b"Python 3")) + .find(|(_, r)| r.stdout.starts_with(b"Python 3") || r.stderr.starts_with(b"Python 3")) .map(|(bin, _)| bin) .expect("Python 3.x interpreter not found") };