Cleanup: replace StringIO seek() & read() with a call to getvalue()

This commit is contained in:
Campbell Barton
2022-12-18 14:18:01 +11:00
parent 8709a51fa9
commit 5a761a47e1
3 changed files with 4 additions and 10 deletions
+1 -2
View File
@@ -65,8 +65,7 @@ def expect_output_or_abort(*, fn, match_stderr=None, match_stdout=None):
for (handle, match) in ((stdout, match_stdout), (stderr, match_stderr)):
if not match:
continue
handle.seek(0)
output = handle.read()
output = handle.getvalue()
if not re.match(match, output):
print_fail_msg_and_exit("%r not found in %r" % (match, output))