mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Add double quotes for Windows python.exe paths if they contain space
This commit is contained in:
parent
2a0acb595c
commit
cd5c47eb63
|
@ -628,7 +628,10 @@ def protect_pip_from_modification_on_windows(modifying_pip: bool) -> None:
|
||||||
)
|
)
|
||||||
|
|
||||||
if should_show_use_python_msg:
|
if should_show_use_python_msg:
|
||||||
new_command = [sys.executable, "-m", "pip"] + sys.argv[1:]
|
sys_executable = sys.executable
|
||||||
|
if " " in sys_executable:
|
||||||
|
sys_executable = f'"{sys_executable}"'
|
||||||
|
new_command = [sys_executable, "-m", "pip"] + sys.argv[1:]
|
||||||
raise CommandError(
|
raise CommandError(
|
||||||
"To modify pip, please run the following command:\n{}".format(
|
"To modify pip, please run the following command:\n{}".format(
|
||||||
" ".join(new_command)
|
" ".join(new_command)
|
||||||
|
|
Loading…
Reference in a new issue