summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-23 04:31:40 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-23 04:31:40 +0100
commit9543a325acbed4ad58294fe97556ef2acc9e961b (patch)
tree495ddb1c6bd64692aae15276ac9750483dec92e0
parent9baabed7186c319d6dff6c295c96b26f3832ba1d (diff)
lib.sh: further simplify the python check
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/lib.sh8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/lib.sh b/include/lib.sh
index 45eb2b3d..eda338a0 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -98,13 +98,9 @@ for fv in version versiondate; do
eval "[ ! -f \".$fv\" ] || read -r $fv < \".$fv\" || :"
done
-pyver="2"
python="python3"
-if command -v python3 1>/dev/null; then
- pyver="3"
-else
- python="python"
-fi
+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 \