From 781fc83478c28776cec886f283d613e84f7fcc20 Mon Sep 17 00:00:00 2001 From: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com> Date: Tue, 13 Apr 2021 23:03:33 +0800 Subject: [PATCH 1/4] Use python 3.8 or higher to compile cpython --- PCbuild/find_python.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PCbuild/find_python.bat b/PCbuild/find_python.bat index 75413cdbfcf431..d0e4a86b01fd03 100644 --- a/PCbuild/find_python.bat +++ b/PCbuild/find_python.bat @@ -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% From 83689f0fcb908a546d9185daf9f2d64827c4fa15 Mon Sep 17 00:00:00 2001 From: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com> Date: Wed, 14 Apr 2021 18:31:38 +0800 Subject: [PATCH 2/4] Update find_python.bat Apply suggestions by Jeremy Co-Authored-By: Jeremy Kloth <20042737+jkloth@users.noreply.github.com> --- PCbuild/find_python.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCbuild/find_python.bat b/PCbuild/find_python.bat index d0e4a86b01fd03..c2f2879aec2492 100644 --- a/PCbuild/find_python.bat +++ b/PCbuild/find_python.bat @@ -37,7 +37,7 @@ @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.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 +for /F "tokens=2 delims=-" %%p in ('py -0 2^>nul') do @py -%%p -Ec "import sys; assert sys.version_info[:2] >= (3, 8)" >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% From de86c3857c256863e235eba6a848db6e66fae07a Mon Sep 17 00:00:00 2001 From: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com> Date: Tue, 20 Apr 2021 23:07:28 +0800 Subject: [PATCH 3/4] Add news --- .../next/Windows/2021-04-20-23-07-22.bpo-40432.9OFpoq.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Windows/2021-04-20-23-07-22.bpo-40432.9OFpoq.rst diff --git a/Misc/NEWS.d/next/Windows/2021-04-20-23-07-22.bpo-40432.9OFpoq.rst b/Misc/NEWS.d/next/Windows/2021-04-20-23-07-22.bpo-40432.9OFpoq.rst new file mode 100644 index 00000000000000..6f8ce00bf99ecc --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2021-04-20-23-07-22.bpo-40432.9OFpoq.rst @@ -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. From 702ea51c8d9ac2585c116f015a4212520af3a0d6 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Mon, 26 Apr 2021 19:40:34 +0100 Subject: [PATCH 4/4] Use static list of versions --- PCbuild/find_python.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCbuild/find_python.bat b/PCbuild/find_python.bat index c2f2879aec2492..d0e4a86b01fd03 100644 --- a/PCbuild/find_python.bat +++ b/PCbuild/find_python.bat @@ -37,7 +37,7 @@ @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 /F "tokens=2 delims=-" %%p in ('py -0 2^>nul') do @py -%%p -Ec "import sys; assert sys.version_info[:2] >= (3, 8)" >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%