Find the build directory matching the current interpreter
authorDmitry Shachnev <mitya57@debian.org>
Sun, 14 Nov 2021 18:08:50 +0000 (21:08 +0300)
committerChristian Marillat <marillat@debian.org>
Fri, 17 Jun 2022 15:49:37 +0000 (16:49 +0100)
This is needed to allow us to run tests with all supported Python versions.
Without this patch, the latest build directory will be always picked, no
matter what the current interpreter is.

Gbp-Pq: Name test-with-current-interpreter.patch

testing/buildlog.py

index 216282b4cbaae267e751f039ef50eddbb031b3e4..5d3aa1f933ba52c8baabba166421ae7621f557d2 100644 (file)
@@ -94,6 +94,11 @@ class BuildLog(object):
                     """.format(fpath)))
                     sys.exit(1)
 
+                # We need to find the build directory for the current interpreter
+                py_version = "{}.{}".format(sys.version_info[0], sys.version_info[1])
+                if py_version not in build_classifiers:
+                    continue
+
                 if not os.path.exists(build_dir):
                     rel_dir, low_part = os.path.split(build_dir)
                     rel_dir, two_part = os.path.split(rel_dir)