Check that the tests are using recent version of python3.
Ensure that we are using python3 from this decade,
so the we can use some of the more recent features.
Test: ./art/test/testrunner/run_build_test_target.py -j80 art-test
Change-Id: Ic1926a767ff438877645a79d0e6064baa9e2983b
diff --git a/test/testrunner/run_build_test_target.py b/test/testrunner/run_build_test_target.py
index 2e4e91a..f3a73bd 100755
--- a/test/testrunner/run_build_test_target.py
+++ b/test/testrunner/run_build_test_target.py
@@ -29,12 +29,18 @@
import argparse
import os
import pathlib
+import re
import subprocess
import sys
from target_config import target_config
import env
+# Check that we are using reasonably recent version of python
+print("Using", sys.executable, sys.version, flush=True)
+version = tuple(map(int, re.match(r"(\d*)\.(\d*)", sys.version).groups()))
+assert (version >= (3, 9)), "Python version is too old"
+
parser = argparse.ArgumentParser()
parser.add_argument('-j', default='1', dest='n_threads')
# either -l/--list OR build-target is required (but not both).