From: Jean-Frederic Clere Date: Fri, 14 Aug 2026 17:34:58 +0000 (+0000) Subject: Arrange python detection. X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=0b6fd625d049655fab09a6691587bf89c1ea5096;p=thirdparty%2Fapache%2Fhttpd.git Arrange python detection. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1937129 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/pytest_suite/runtests.bat b/test/pytest_suite/runtests.bat index ca679739cc..0556cabb68 100644 --- a/test/pytest_suite/runtests.bat +++ b/test/pytest_suite/runtests.bat @@ -26,8 +26,21 @@ if "%HERE:~-1%"=="\" set "HERE=%HERE:~0,-1%" cd /d "%HERE%" -rem --- python location -set PYTHON=%LOCALAPPDATA%\Programs\Python\Python314\python.exe +rem --- python location: find the newest native Windows Python 3.x +set PYTHON= +for /f "delims=" %%D in ('dir /b /o-n "%LOCALAPPDATA%\Programs\Python\Python3*" 2^>nul') do ( + if not defined PYTHON set "PYTHON=%LOCALAPPDATA%\Programs\Python\%%D\python.exe" +) +if not defined PYTHON ( + for /f "delims=" %%D in ('dir /b /o-n "%PROGRAMFILES%\Python3*" 2^>nul') do ( + if not defined PYTHON set "PYTHON=%PROGRAMFILES%\%%D\python.exe" + ) +) +if not defined PYTHON ( + echo runtests.bat: ERROR: Python interpreter not found. >&2 + echo Install Python from https://www.python.org or set PYTHON=... >&2 + exit /b 1 +) rem --- ensure the venv exists and is current ---------------------------------- set "PYTEST=%HERE%\.venv\Scripts\pytest.exe"