We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1e059a commit 2893b4cCopy full SHA for 2893b4c
tools/msvs/find_python.cmd
@@ -46,6 +46,8 @@ exit /b 1
46
47
:found-python
48
echo Python found in %p%\python.exe
49
+call :check-python %p%\python.exe
50
+if errorlevel 1 goto :no-python
51
endlocal ^
52
& set "pt=%p%" ^
53
& set "need_path_ext=%need_path%"
@@ -54,6 +56,15 @@ set "pt="
54
56
set "need_path_ext="
55
57
exit /b 0
58
59
+:check-python
60
+%~1 -V
61
+:: 9009 means error file not found
62
+if %errorlevel% equ 9009 (
63
+ echo Not an executable Python program
64
+ exit /b 1
65
+)
66
+exit /b 0
67
+
68
:no-python
69
echo Could not find Python.
70
exit /b 1
0 commit comments