Revise messages in find_python3 Also change the test for failure of "which" to a string comparison.
diff --git a/ChangeLog b/ChangeLog index b66d917..6eb3fbf 100644 --- a/ChangeLog +++ b/ChangeLog
@@ -2,8 +2,10 @@ * baseboards/bpf-vmtest.exp: Allow user to override search for Python 3 interpreter. - (bpf-vmtest_compile, bpf-vmtest_load): Use Tcl line + (find_python3, bpf-vmtest_compile, bpf-vmtest_load): Use Tcl line continuation to wrap long lines. + (find_python3): Revise messages and change test for failure of + "which" to string comparison. 2026-03-24 Jacob Bachmeyer <jcb@gnu.org>
diff --git a/baseboards/bpf-vmtest.exp b/baseboards/bpf-vmtest.exp index 604886b..9d99bed 100644 --- a/baseboards/bpf-vmtest.exp +++ b/baseboards/bpf-vmtest.exp
@@ -31,22 +31,25 @@ global timeout foreach candidate {python3 python} { set path [which $candidate] - if {$path != 0 } { + if { $path ne 0 } { set status [local_exec "$path -V" "" "" $timeout] set exit_code [lindex $status 0] set output [lindex $status 1] if { $exit_code == 0 } { set version [lindex [split [string trim $output] " "] 1 ] + verbose -log "Found Python $version at $path" 2 if { [package vcompare $version 3.9.0] >= 0 } { verbose -log "Using Python interpreter at $path" 1 return $path } else { - verbose -log "Python 3.9 or newer is required; found $version for $path" 2 + verbose -log \ + "Python 3.9 or newer is required; still looking..." 2 continue } } else { - verbose -log "Failed to retrieve the Python version from $path (exit code: $exit_code)" 2 + verbose -log \ + "Python $path rejected -V with exit code $exit_code" 2 continue } @@ -54,7 +57,7 @@ verbose -log "\'$candidate\' not found in \$PATH" 2 } } - perror "No Python interpreter with version 3.9 or higher was found in \$PATH" + perror "Python 3.9 or higher was not found in \$PATH" exit 1 }