diff --git a/crates/uv-python/src/interpreter.rs b/crates/uv-python/src/interpreter.rs index 2c4cb653b..4e4132b0d 100644 --- a/crates/uv-python/src/interpreter.rs +++ b/crates/uv-python/src/interpreter.rs @@ -54,6 +54,7 @@ pub struct Interpreter { prefix: Option, pointer_size: PointerSize, gil_disabled: bool, + real_executable: PathBuf, } impl Interpreter { @@ -86,6 +87,7 @@ impl Interpreter { tags: OnceLock::new(), target: None, prefix: None, + real_executable: executable.as_ref().to_path_buf(), }) } @@ -393,6 +395,11 @@ impl Interpreter { &self.sys_executable } + /// Return the "real" queried executable path for this Python interpreter. + pub fn real_executable(&self) -> &Path { + &self.real_executable + } + /// Return the `sys.path` for this Python interpreter. pub fn sys_path(&self) -> &Vec { &self.sys_path diff --git a/crates/uv/src/commands/python/list.rs b/crates/uv/src/commands/python/list.rs index d71850aca..3e604ee8d 100644 --- a/crates/uv/src/commands/python/list.rs +++ b/crates/uv/src/commands/python/list.rs @@ -148,7 +148,7 @@ pub(crate) async fn list( output.insert(( installation.key(), kind, - Either::Left(installation.interpreter().sys_executable().to_path_buf()), + Either::Left(installation.interpreter().real_executable().to_path_buf()), )); } }