summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/lib.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/lib.sh b/include/lib.sh
index 21066ecc..d72f0378 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -2,6 +2,7 @@
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
+# Copyright (c) 2025 Alper Nebi Yasak <alpernebiyasak@gmail.com>
export LC_COLLATE=C
export LC_ALL=C
@@ -99,13 +100,17 @@ done
pyver="2"
python="python3"
-command -v python3 1>/dev/null || python="python"
+if command -v python3 1>/dev/null; then
+ pyver="3"
+else
+ python="python"
+fi
command -v $python 1>/dev/null || pyver=""
[ -z "$pyver" ] || \
- python -c 'import sys; print(sys.version_info[:])' 1>/dev/null \
+ $python -c 'import sys; print(sys.version_info[:])' 1>/dev/null \
2>/dev/null || $err "Cannot determine which Python version."
[ -n "$pyver" ] && \
- pyver="`python -c 'import sys; print(sys.version_info[:])' | \
+ pyver="`$python -c 'import sys; print(sys.version_info[:])' | \
awk '{print $1}'`" && \
pyver="${pyver#(}" && pyver="${pyver%,}"
if [ "${pyver%%.*}" != "3" ]; then