Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a8a8cc7

Browse files
bpo-34267: Update find_python.bat to use 3.7 if available (GH-8552)
(cherry picked from commit 6750922) Co-authored-by: Steve Dower <[email protected]>
1 parent b7f58d7 commit a8a8cc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PCbuild/find_python.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
@if NOT "%HOST_PYTHON%"=="" @%HOST_PYTHON% -Ec "import sys; assert sys.version_info[:2] >= (3, 6)" >nul 2>nul && (set PYTHON="%HOST_PYTHON%") && (set _Py_Python_Source=found as HOST_PYTHON) && goto :found
3535

3636
@rem If py.exe finds a recent enough version, use that one
37-
@py -3.6 -EV >nul 2>&1 && (set PYTHON=py -3.6) && (set _Py_Python_Source=found with py.exe) && goto :found
37+
@for %%p in (3.7 3.6) do @py -%%p -EV >nul 2>&1 && (set PYTHON=py -%%p) && (set _Py_Python_Source=found %%p with py.exe) && goto :found
3838

3939
@if NOT exist "%_Py_EXTERNALS_DIR%" mkdir "%_Py_EXTERNALS_DIR%"
4040
@set _Py_NUGET=%NUGET%
@@ -55,7 +55,7 @@
5555
)
5656
@echo Installing Python via nuget...
5757
@"%_Py_NUGET%" install pythonx86 -ExcludeVersion -OutputDirectory "%_Py_EXTERNALS_DIR%"
58-
@rem Quote it here; it's not quoted later because "py -3.6" wouldn't work
58+
@rem Quote it here; it's not quoted later because "py -x.y" wouldn't work
5959
@if not errorlevel 1 (set PYTHON="%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe") & (set _Py_Python_Source=found on nuget.org) & goto :found
6060

6161

0 commit comments

Comments
 (0)