Rollup merge of #126960 - Kobzol:tidy-venv-message, r=tgross35

Improve error message in tidy

The old error message was wrong (there is no `venv` Python package on PyPi), and we did not specify the correct Python path in the error message.
This commit is contained in:
Matthias Krüger 2024-06-29 22:10:56 +02:00 committed by GitHub
commit 6df68793f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -364,11 +364,10 @@ fn create_venv_at_path(path: &Path) -> Result<(), Error> {
let stderr = String::from_utf8_lossy(&out.stderr);
let err = if stderr.contains("No module named virtualenv") {
Error::Generic(
Error::Generic(format!(
"virtualenv not found: you may need to install it \
(`python3 -m pip install venv`)"
.to_owned(),
)
(`{sys_py} -m pip install virtualenv`)"
))
} else {
Error::Generic(format!(
"failed to create venv at '{}' using {sys_py}: {stderr}",