]> git.proxmox.com Git - mirror_qemu.git/blobdiff - configure
configure: Insist on a Python 2, not Python 3
[mirror_qemu.git] / configure
index b392c6f39039cb8080c3844acb4e8d16d77da220..1d94acda2c65cd8e4b4d51e0f2e46c7c4ce98696 100755 (executable)
--- a/configure
+++ b/configure
@@ -1242,6 +1242,14 @@ if ! has $python; then
   exit 1
 fi
 
+# Note that if the Python conditional here evaluates True we will exit
+# with status 1 which is a shell 'false' value.
+if ! "$python" -c 'import sys; sys.exit(sys.version_info[0] >= 3)'; then
+  echo "Python 2 required but '$python' is version 3 or better."
+  echo "Use --python=/path/to/python to specify a Python 2."
+  exit 1
+fi
+
 if test -z "$target_list" ; then
     target_list="$default_target_list"
 else