Ignore stderr when checking for Python version
https://review.openstack.org/504171 prevented Python version detection from failing when python3 is not installed. However, "which python3" returns a message in stderr when python3 is not there, and this output can make diskimage-builder get confused when parsing source-repository-images. Change-Id: Idb649dc341ede73c39954b0432ef3cacf379ed37
This commit is contained in:
parent
f56a0ae2ec
commit
6bd4924cec
@ -2081,7 +2081,7 @@ function _get_python_version {
|
||||
local interp=$1
|
||||
local version
|
||||
# disable erroring out here, otherwise if python 3 doesn't exist we fail hard.
|
||||
if [[ -x $(which $interp) ]]; then
|
||||
if [[ -x $(which $interp 2> /dev/null) ]]; then
|
||||
version=$($interp -c 'import sys; print("%s.%s" % sys.version_info[0:2])')
|
||||
fi
|
||||
echo ${version}
|
||||
|
Loading…
x
Reference in New Issue
Block a user