From: Victor Stinner Date: Thu, 3 Sep 2015 13:42:26 +0000 (+0200) Subject: test_gdb: oops, the regex to parse the gdb version was still too strict X-Git-Tag: v3.5.1rc1~427^2~33^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=479fea63e1b321a8fe47af1bb62e87f47b6c45c0;p=python test_gdb: oops, the regex to parse the gdb version was still too strict --- diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 5059fb43a4..915c90cc69 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -36,8 +36,9 @@ def get_gdb_version(): # Regex to parse: # 'GNU gdb (GDB; SUSE Linux Enterprise 12) 7.7\n' -> 7.7 # 'GNU gdb (GDB) Fedora 7.9.1-17.fc22\n' -> 7.9 - # 'GNU gdb 6.1.1 [FreeBSD]\n' - match = re.search("^GNU gdb.*? (\d+)\.(\d)", version) + # 'GNU gdb 6.1.1 [FreeBSD]\n' -> 6.1 + # 'GNU gdb (GDB) Fedora (7.5.1-37.fc18)\n' -> 7.5 + match = re.search(r"^GNU gdb.*?\b(\d+)\.(\d)", version) if match is None: raise Exception("unable to parse GDB version: %r" % version) return (version, int(match.group(1)), int(match.group(2)))