diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index b205ff8..caf3b0e 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -87,10 +87,20 @@ jobs: # does NOT have plain "python" in PATH, but py.exe is installed system-wide. $venvPy = Join-Path $env:VENV_DIR 'Scripts\python.exe' + # Probe: a broken venv (pyvenv.cfg pointing to a deleted base interpreter) + # writes "No Python at ..." to stderr; under $ErrorActionPreference='Stop' + # native stderr becomes a terminating exception (AGENTS.md error #12), + # so probe with SilentlyContinue + try/catch. $venvOk = $false if (Test-Path $venvPy) { - & $venvPy --version 2>&1 | Out-Null - if ($LASTEXITCODE -eq 0) { $venvOk = $true } + try { + $prevEAP = $ErrorActionPreference + $ErrorActionPreference = 'SilentlyContinue' + & $venvPy --version 2>&1 | Out-Null + if ($LASTEXITCODE -eq 0) { $venvOk = $true } + } + catch { $venvOk = $false } + finally { $ErrorActionPreference = $prevEAP } } if (-not $venvOk) {