]> granicus.if.org Git - python/commitdiff
test_gdb: add debug info to investigate failure on "s390x SLES 3.x" buildbot
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 2 Sep 2015 13:44:22 +0000 (15:44 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 2 Sep 2015 13:44:22 +0000 (15:44 +0200)
Lib/test/test_gdb.py

index 0322677793a52488434ae8893d246307183c406e..193c97afa35467648c915404a0e344e94b0e01d3 100644 (file)
@@ -28,9 +28,13 @@ except OSError:
     # This is what "no gdb" looks like.  There may, however, be other
     # errors that manifest this way too.
     raise unittest.SkipTest("Couldn't find gdb on the path")
-gdb_version_number = re.search(b"^GNU gdb [^\d]*(\d+)\.(\d)", gdb_version)
-gdb_major_version = int(gdb_version_number.group(1))
-gdb_minor_version = int(gdb_version_number.group(2))
+try:
+    gdb_version_number = re.search(b"^GNU gdb [^\d]*(\d+)\.(\d)", gdb_version)
+    gdb_major_version = int(gdb_version_number.group(1))
+    gdb_minor_version = int(gdb_version_number.group(2))
+except Exception:
+    raise ValueError("unable to parse GDB version: %r" % gdb_version)
+
 if gdb_major_version < 7:
     raise unittest.SkipTest("gdb versions before 7.0 didn't support python embedding"
                             " Saw:\n" + gdb_version.decode('ascii', 'replace'))