summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-23 04:35:18 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-23 04:35:18 +0100
commitb1b964fa5c393cb4651861b14fb4e861ee7c6737 (patch)
tree6ea22e22b35d500b9bdd0f8eefd0a5ab21d9b23c
parent9543a325acbed4ad58294fe97556ef2acc9e961b (diff)
lib.sh: further condense the python checkHEADmaster
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/lib.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/lib.sh b/include/lib.sh
index eda338a0..cd3e14ae 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -102,9 +102,8 @@ python="python3"
command -v python3 1>/dev/null || python="python"
pyver="2" && [ "$python" = "python3" ] && pyver="3"
command -v $python 1>/dev/null || pyver=""
-[ -z "$pyver" ] || \
- $python -c 'import sys; print(sys.version_info[:])' 1>/dev/null \
- 2>/dev/null || $err "Cannot determine which Python version."
+[ -z "$pyver" ] || $python -c 'import sys; print(sys.version_info[:])' \
+ 1>/dev/null 2>/dev/null || $err "Cannot detect host Python version."
[ -n "$pyver" ] && \
pyver="`$python -c 'import sys; print(sys.version_info[:])' | \
awk '{print $1}'`" && pyver="${pyver#(}" && pyver="${pyver%,}"