scripts: prereqs: Use python3.10 as python3

Debian testing updated to use python3.11 as default, but the system is
stable in python3.10. Force the system to use python3.10 in CI

rotede still uses python3.10 as the default python3, so this should be
a no-op for the developers.

Bug: 267082842
Change-Id: Ib2247346f1d0b7c2a4eea302f3fbbfd5475f0e45
diff --git a/install-prereqs.sh b/install-prereqs.sh
index d3eed72..6dab5cb 100755
--- a/install-prereqs.sh
+++ b/install-prereqs.sh
@@ -114,6 +114,12 @@
     sudo "$@" || die
 }
 
+function try_use_python3_10 {
+  echo "Update Python3 to use Python 3.10"
+  sudo_try ln -sf /usr/bin/python3.10 /usr/bin/python3
+  echo "Python version : $(python3 --version)"
+}
+
 function try_install_apt_packages {
     sudo_try apt-get update
     sudo_try apt-get install -y "${APT_PACKAGES[@]}"
@@ -121,6 +127,9 @@
     if [[ ! -z "${APT_REQUIREMENTS}" ]]; then
         sed 's/#.*//' "${APT_REQUIREMENTS}" | sudo_try xargs apt-get install -y
     fi
+
+    # Force python3 to use python3.10 (b/267082842)
+    python3 --version | grep "Python 3.10" || try_use_python3_10
 }
 
 function try_install_python_packages {