> -python_version=$($python -V 2>&1 | sed -e 's/Python\ //') > +python_version=$(python2 -c 'import sys; print("%d.%d.%d" % > (sys.version_info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null)
On a Python 3 only system, configure will no longer print the version. e.g. /* snip */ install install python python3 -B () slirp support git /* snip */ > @@ -6511,6 +6511,7 @@ if ! $python -c 'import sys; sys.exit(sys.version_info > < (3,0))'; then > echo > echo "warning: Python 2 support is deprecated" >&2 > echo "warning: Python 3 will be required for building future versions of > QEMU" >&2 > + python2="y" > fi ... > -echo "PYTHON_VERSION=$python_version" >> $config_host_mak > +echo "PYTHON2=$python2" >> $config_host_mak ... > -ifneq ($(findstring v2,"v$(PYTHON_VERSION)"),v2) > +ifneq ($(PYTHON2),y) Succinctly, if Python 3. We can further ween the world off Python 2 by replacing python2="y" for python3="y" and PYTHON2 for PYTHON3.