diff --git a/src/build_options.rs b/src/build_options.rs index 225cf73f3..a4c8bad55 100644 --- a/src/build_options.rs +++ b/src/build_options.rs @@ -1083,10 +1083,7 @@ fn find_interpreter_in_sysconfig( } let mut interpreters = Vec::new(); for interp in interpreter { - let python = interp - .file_name() - .context("Invalid python interpreter")? - .to_string_lossy(); + let python = interp.display().to_string(); let (python_impl, python_ver) = if let Some(ver) = python.strip_prefix("pypy") { (InterpreterKind::PyPy, ver.strip_prefix('-').unwrap_or(ver)) } else if let Some(ver) = python.strip_prefix("python") {