Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 479fea6

Browse files
committed
test_gdb: oops, the regex to parse the gdb version was still too strict
1 parent a7b76e0 commit 479fea6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/test_gdb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ def get_gdb_version():
3636
# Regex to parse:
3737
# 'GNU gdb (GDB; SUSE Linux Enterprise 12) 7.7\n' -> 7.7
3838
# 'GNU gdb (GDB) Fedora 7.9.1-17.fc22\n' -> 7.9
39-
# 'GNU gdb 6.1.1 [FreeBSD]\n'
40-
match = re.search("^GNU gdb.*? (\d+)\.(\d)", version)
39+
# 'GNU gdb 6.1.1 [FreeBSD]\n' -> 6.1
40+
# 'GNU gdb (GDB) Fedora (7.5.1-37.fc18)\n' -> 7.5
41+
match = re.search(r"^GNU gdb.*?\b(\d+)\.(\d)", version)
4142
if match is None:
4243
raise Exception("unable to parse GDB version: %r" % version)
4344
return (version, int(match.group(1)), int(match.group(2)))

0 commit comments

Comments
 (0)