Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit adcde6b

Browse filesBrowse files
himself65ruyadorno
authored andcommitted
build: check if python is a executable program
After Windows 10 version 1903, placeholder files named "python.exe" and "python3.exe" appear, not executable programs, and open the MS Store when running without parameters. Fixes: #36694 Refs: https://devblogs.microsoft.com/python/python-in-the-windows-10-may-2019-update PR-URL: #36696 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 14cb9ea commit adcde6b
Copy full SHA for adcde6b

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Collapse file

‎tools/msvs/find_python.cmd‎

Copy file name to clipboardExpand all lines: tools/msvs/find_python.cmd
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ exit /b 1
4646

4747
:found-python
4848
echo Python found in %p%\python.exe
49+
call :check-python %p%\python.exe
50+
if errorlevel 1 goto :no-python
4951
endlocal ^
5052
& set "pt=%p%" ^
5153
& set "need_path_ext=%need_path%"
@@ -54,6 +56,15 @@ set "pt="
5456
set "need_path_ext="
5557
exit /b 0
5658

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+
5768
:no-python
5869
echo Could not find Python.
5970
exit /b 1

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.