mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-19 03:25:20 +00:00
fix: Fix the python module ignoring error codes (#563)
This is a quick fix to stop the python module from displaying error messages that have been printed to stderr as the version.
This commit is contained in:
parent
7e21f5c6b6
commit
7b9197a67e
@ -68,6 +68,13 @@ fn get_pyenv_version() -> Option<String> {
|
||||
fn get_python_version() -> Option<String> {
|
||||
match Command::new("python").arg("--version").output() {
|
||||
Ok(output) => {
|
||||
if !output.status.success() {
|
||||
log::warn!(
|
||||
"Non-Zero exit code '{}' when executing `python --version`",
|
||||
output.status
|
||||
);
|
||||
return None;
|
||||
}
|
||||
// We have to check both stdout and stderr since for Python versions
|
||||
// < 3.4, Python reports to stderr and for Python version >= 3.5,
|
||||
// Python reports to stdout
|
||||
|
Loading…
Reference in New Issue
Block a user