qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] configure: more resilient Python version captur


From: tony.nguyen
Subject: Re: [Qemu-devel] [PATCH] configure: more resilient Python version capture
Date: Sat, 24 Aug 2019 07:32:24 +0000

> -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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]