mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #12400: regrtest.runtest() uses stream.seek(0) before .truncate()
.truncate(0) doesn't rewind.
This commit is contained in:
parent
592f679dce
commit
fcc2a21fae
1 changed files with 6 additions and 3 deletions
|
@ -791,9 +791,12 @@ def runtest(test, verbose, quiet,
|
||||||
# tests keep a reference to sys.stdout or sys.stderr
|
# tests keep a reference to sys.stdout or sys.stderr
|
||||||
# (eg. test_argparse).
|
# (eg. test_argparse).
|
||||||
if runtest.stringio is None:
|
if runtest.stringio is None:
|
||||||
runtest.stringio = io.StringIO()
|
stream = io.StringIO()
|
||||||
stream = runtest.stringio
|
runtest.stringio = stream
|
||||||
stream.truncate(0)
|
else:
|
||||||
|
stream = runtest.stringio
|
||||||
|
stream.seek(0)
|
||||||
|
stream.truncate()
|
||||||
|
|
||||||
orig_stdout = sys.stdout
|
orig_stdout = sys.stdout
|
||||||
orig_stderr = sys.stderr
|
orig_stderr = sys.stderr
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue