python: Check for activate script existence before running it (#22792)

Closes #ISSUE

Release Notes:

- Python auto-venv activation in terminal now checks for path existence
before executing the activate script.
This commit is contained in:
Piotr Osiewicz
2025-01-07 20:57:58 +00:00
committed by GitHub
parent 9d5ae516fd
commit 7a66c764b4
+3
View File
@@ -433,6 +433,9 @@ impl Project {
"windows" => "\r",
_ => "\n",
};
if smol::block_on(self.fs.metadata(path.as_ref())).is_err() {
return None;
}
Some(format!(
"{} {} ; clear{}",
activate_keyword, quoted, line_ending