Skip to content

Commit f65f3f0

Browse files
bpo-40432: Use python 3.8 or higher to compile CPython on Windows (GH-25389) (#25637)
(cherry picked from commit 425434d) Co-authored-by: Ken Jin <[email protected]>
1 parent ba7338a commit f65f3f0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Updated pegen regeneration script on Windows to find and use Python 3.8 or
2+
higher. Prior to this, pegen regeneration already required 3.8 or higher,
3+
but the script may have used lower versions of Python.

PCbuild/find_python.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
@if exist "%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe" (set PYTHON="%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe") & (set _Py_Python_Source=found in externals directory) & goto :found
3535

3636
@rem If HOST_PYTHON is recent enough, use that
37-
@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
37+
@if NOT "%HOST_PYTHON%"=="" @%HOST_PYTHON% -Ec "import sys; assert sys.version_info[:2] >= (3, 8)" >nul 2>nul && (set PYTHON="%HOST_PYTHON%") && (set _Py_Python_Source=found as HOST_PYTHON) && goto :found
3838

3939
@rem If py.exe finds a recent enough version, use that one
40-
@for %%p in (3.8 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
40+
@for %%p in (3.9 3.8) do @py -%%p -EV >nul 2>&1 && (set PYTHON=py -%%p) && (set _Py_Python_Source=found %%p with py.exe) && goto :found
4141

4242
@if NOT exist "%_Py_EXTERNALS_DIR%" mkdir "%_Py_EXTERNALS_DIR%"
4343
@set _Py_NUGET=%NUGET%

0 commit comments

Comments
 (0)