Skip to content

Commit 88d922a

Browse files
authored
gh-159914: Ignore gdb stderr in test_gdb.test_pretty_print (#159916)
test_strings() gets gdb.host_charset(), but fails if gdb writes anything to stderr. For example, it fails if gdb logs the warning: "/usr/bin/gdb: warning: Couldn't determine a path for the index cache directory." Even if stdout contains the expected encoding ("UTF-8"). Change test_gdb to only fail if stdout is empty, ignore stderr otherwise to ignore gdb warnings.
1 parent 39d7c0f commit 88d922a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Lib/test/test_gdb/test_pretty_print.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def test_strings(self):
125125
'python import gdb; print(gdb.host_charset())')
126126

127127
encoding = stdout.strip()
128-
if stderr or not encoding:
128+
if not encoding:
129129
raise RuntimeError(
130130
f'unable to determine the host charset of gdb\n'
131131
f'stdout={stdout!r}\n'

0 commit comments

Comments
 (0)