Skip to content

Commit 6df6879

Browse files
authored
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.
2 parents 5b90824 + 8a87f02 commit 6df6879

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/tools/tidy/src/ext_tool_checks.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,10 @@ fn create_venv_at_path(path: &Path) -> Result<(), Error> {
364364

365365
let stderr = String::from_utf8_lossy(&out.stderr);
366366
let err = if stderr.contains("No module named virtualenv") {
367-
Error::Generic(
367+
Error::Generic(format!(
368368
"virtualenv not found: you may need to install it \
369-
(`python3 -m pip install venv`)"
370-
.to_owned(),
371-
)
369+
(`{sys_py} -m pip install virtualenv`)"
370+
))
372371
} else {
373372
Error::Generic(format!(
374373
"failed to create venv at '{}' using {sys_py}: {stderr}",

0 commit comments

Comments
 (0)