From 0b4ac0a34816ca557cd54e20a5838e986f3c19fb Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 13 Nov 2017 15:38:34 -0800 Subject: [PATCH] Simplify our "does this image contain the expected Python" test --- test/tests/python-hy/container.sh | 4 ++-- test/tests/run-python-in-container.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tests/python-hy/container.sh b/test/tests/python-hy/container.sh index dcf142a0f..5cec5f24e 100644 --- a/test/tests/python-hy/container.sh +++ b/test/tests/python-hy/container.sh @@ -3,8 +3,8 @@ set -e python= for c in pypy3 pypy python3 python; do - if PATH=/usr/local/bin command -v "$c" > /dev/null; then - python="$c" + if [ -x "/usr/local/bin/$c" ]; then + python="/usr/local/bin/$c" break fi done diff --git a/test/tests/run-python-in-container.sh b/test/tests/run-python-in-container.sh index 017add195..5af2bfa72 100755 --- a/test/tests/run-python-in-container.sh +++ b/test/tests/run-python-in-container.sh @@ -6,8 +6,8 @@ runDir="$(dirname "$(readlink -f "$BASH_SOURCE")")" source "$runDir/run-in-container.sh" "$testDir" "$1" sh -ec ' for c in pypy3 pypy python3 python; do - if PATH=/usr/local/bin command -v "$c" > /dev/null; then - exec "$c" "$@" + if [ -x "/usr/local/bin/$c" ]; then + exec "/usr/local/bin/$c" "$@" fi done echo >&2 "error: unable to determine how to run python"