Skip to content

Commit

Permalink
bpo-40432: Use python 3.8 or higher to compile CPython on Windows (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
Fidget-Spinner committed Apr 26, 2021
1 parent 8a307e4 commit 425434d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
@@ -0,0 +1,3 @@
Updated pegen regeneration script on Windows to find and use Python 3.8 or
higher. Prior to this, pegen regeneration already required 3.8 or higher,
but the script may have used lower versions of Python.
4 changes: 2 additions & 2 deletions PCbuild/find_python.bat
Expand Up @@ -34,10 +34,10 @@
@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

@rem If HOST_PYTHON is recent enough, use that
@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
@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

@rem If py.exe finds a recent enough version, use that one
@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
@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

@if NOT exist "%_Py_EXTERNALS_DIR%" mkdir "%_Py_EXTERNALS_DIR%"
@set _Py_NUGET=%NUGET%
Expand Down

0 comments on commit 425434d

Please sign in to comment.