Skip to content

Commit 2f46c65

Browse files
bpo-34401: Fix test_gdb for HP GDB version string (GH-20804)
The GDB provided by HPE on HP-UX contains a modified version string. Therefore the tests fail. Adapt the regex to match that string. Patch by Michael Osipov. Co-Authored-by: Michael Osipov <[email protected]> (cherry picked from commit b2dca49) Co-authored-by: Victor Stinner <[email protected]>
1 parent 961edf7 commit 2f46c65

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/test/test_gdb.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def get_gdb_version():
3939
# 'GNU gdb (GDB) Fedora 7.9.1-17.fc22\n' -> 7.9
4040
# 'GNU gdb 6.1.1 [FreeBSD]\n' -> 6.1
4141
# 'GNU gdb (GDB) Fedora (7.5.1-37.fc18)\n' -> 7.5
42-
match = re.search(r"^GNU gdb.*?\b(\d+)\.(\d+)", version)
42+
# 'HP gdb 6.7 for HP Itanium (32 or 64 bit) and target HP-UX 11iv2 and 11iv3.\n' -> 6.7
43+
match = re.search(r"^(?:GNU|HP) gdb.*?\b(\d+)\.(\d+)", version)
4344
if match is None:
4445
raise Exception("unable to parse GDB version: %r" % version)
4546
return (version, int(match.group(1)), int(match.group(2)))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make test_gdb properly run on HP-UX. Patch by Michael Osipov.

0 commit comments

Comments
 (0)