Skip to content

Commit e2ff1c3

Browse files
authored
build: improve reliability of find_python.cmd script
The path of the Python executable might contain white spaces. Handle this when the `check-python` function is called. Fixes: #42801 PR-URL: #42810 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 603803e commit e2ff1c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/msvs/find_python.cmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exit /b 1
4646

4747
:found-python
4848
echo Python found in %p%\python.exe
49-
call :check-python %p%\python.exe
49+
call :check-python "%p%\python.exe"
5050
if errorlevel 1 goto :no-python
5151
endlocal ^
5252
& set "pt=%p%" ^
@@ -57,7 +57,7 @@ set "need_path_ext="
5757
exit /b 0
5858

5959
:check-python
60-
%~1 -V
60+
%1 -V
6161
:: 9009 means error file not found
6262
if %errorlevel% equ 9009 (
6363
echo Not an executable Python program

0 commit comments

Comments
 (0)