Skip to content

Commit

Permalink
Rollup merge of #126960 - Kobzol:tidy-venv-message, r=tgross35
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthiaskrgr committed Jun 29, 2024
2 parents 5b90824 + 8a87f02 commit 6df6879
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/tools/tidy/src/ext_tool_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down

0 comments on commit 6df6879

Please sign in to comment.