Commit 62705066 authored by Victor Stinner's avatar Victor Stinner

(merge 3.2) Issue #12400: regrtest.runtest() uses stream.seek(0) before .truncate()

.truncate(0) doesn't rewind.
parents 1f5f9a2e 3d513b78
......@@ -845,9 +845,12 @@ def runtest(test, verbose, quiet,
# tests keep a reference to sys.stdout or sys.stderr
# (eg. test_argparse).
if runtest.stringio is None:
runtest.stringio = io.StringIO()
stream = io.StringIO()
runtest.stringio = stream
else:
stream = runtest.stringio
stream.truncate(0)
stream.seek(0)
stream.truncate()
orig_stdout = sys.stdout
orig_stderr = sys.stderr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment