]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Arrange python detection.
authorJean-Frederic Clere <jfclere@apache.org>
Fri, 14 Aug 2026 17:34:58 +0000 (17:34 +0000)
committerJean-Frederic Clere <jfclere@apache.org>
Fri, 14 Aug 2026 17:34:58 +0000 (17:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1937129 13f79535-47bb-0310-9956-ffa450edef68

test/pytest_suite/runtests.bat

index ca679739cc4b48e6e56da0dae9960251c63ecf6e..0556cabb6896f5a559d593f40dbfa5a411a9799f 100644 (file)
@@ -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"