From: Stefano Rivera <stefanor@debian.org>
Date: Tue, 23 Nov 2021 19:14:16 -0400
Subject: Avoid the hardcoded list of Python versions

Instead stick to Debian's list of supported Pythons.

Bug-Debian: https://bugs.debian.org/998471
Forwarded: not-needed
---
 configure.ac | 4 ++++
 1 file changed, 4 insertions(+)

--- a/configure.ac
+++ b/configure.ac
@@ -318,10 +318,14 @@ else
 
     # Remove duplicates.
     PYTHONS="$(echo $PYTHONS | tr '[[:space:]]' '\n' | sort | uniq | tr '\n' ' ' | sed -e 's/ $//')"
     PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS | tr '[[:space:]]' '\n' | sort | uniq | tr '\n' ' ' | sed -e 's/ $//')"
 
+    # Debian: Avoid relying on the hard-coded list of python versions being up to date:
+    PYTHONS="$(py3versions -s | tr ' ' '\n' | sed s,^,/usr/bin/, | tr '\n' ' ')"
+    PYTHON_VERSIONS="$(py3versions -sv)"
+
     if test -z "$PYTHON_VERSIONS"; then
         AC_MSG_ERROR([[
 ***
 *** Please install the python development packages.
 ***]])
