On a system without Python 't/py-compile-usage' fails with:

    + ./py-compile --help
    + cat stdout
    py-compile: Invalid python executable (according to -V): python
    py-compile: Python support disabled
    + test -s stderr
    + grep '^Usage: py-compile .' stdout
    + am_exit_trap 1
    + exit_status=1

This occurs after the following commit:

    commit 0ea7ef97493cd88da915d1936e04a6ace5c754d8
    Author: Karl Berry <k...@freefriends.org>
    Date:   Sun Feb 9 09:36:24 2025 -0800
    
        python: restore more compatible behavior for $PYTHON.
        
        For https://bugs.gnu.org/74434.
        
        * lib/py-compile: if $PYTHON -V does not include the
        string "python" (case-insensitive), consider the support
        intentionally disabled and exit successfully, unless PYTHON is set
        to false, in which case exit unsuccessfully. This is closer to
        the old behavior. Mention this in the help message.
        * t/py-compile-env.sh: add test for PYTHON=:.
        * NEWS: mention this. (And, en passant, add some past bug#s and
        clarify that only RCS/SCCS pattern rules were disabled, not all.)
    
Simple 1 line fix attached. :)

Collin

>From 5f9001d17fa17088468b650a26a6f876dcdca161 Mon Sep 17 00:00:00 2001
Message-ID: <5f9001d17fa17088468b650a26a6f876dcdca161.1747803682.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Tue, 20 May 2025 22:00:13 -0700
Subject: [PATCH] test: Skip a test that fails without python enabled.

* t/py-compile-usage.sh: Add 'required=python' before sourcing test-init.sh.
---
 t/py-compile-usage.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/py-compile-usage.sh b/t/py-compile-usage.sh
index 0251a76a8..32dc44109 100644
--- a/t/py-compile-usage.sh
+++ b/t/py-compile-usage.sh
@@ -17,6 +17,7 @@
 # Test 'py-compile --help', 'py-compile --version', and that 'py-compile'
 # correctly complains on wrong usage.
 
+required=python
 . test-init.sh
 
 cp "$am_scriptdir/py-compile" . \
-- 
2.49.0

Reply via email to