mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-28 15:09:04 +02:00
Merge pull request 'lib.sh: Fix python3 detection when 'python' is python2' (#290) from alpernebbi/lbmk:python3-detection-fix into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/290
This commit is contained in:
@@ -99,13 +99,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
|
||||
|
||||
Reference in New Issue
Block a user