summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest/refleak.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-29 22:48:27 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-09-29 22:48:27 (GMT)
commitf33536c4308ef1b56a062391ac955c746423e1ee (patch)
treebb6d957c91dbff58cfa2bab25a834d8184dacc69 /Lib/test/libregrtest/refleak.py
parent76f756d9344157d893ce49503327af315c7c3b9c (diff)
downloadcpython-f33536c4308ef1b56a062391ac955c746423e1ee.zip
cpython-f33536c4308ef1b56a062391ac955c746423e1ee.tar.gz
cpython-f33536c4308ef1b56a062391ac955c746423e1ee.tar.bz2
Issue #25220: Use print(flush=True) in libregrtest
Diffstat (limited to 'Lib/test/libregrtest/refleak.py')
-rw-r--r--Lib/test/libregrtest/refleak.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py
index dd0d05d..db8a445 100644
--- a/Lib/test/libregrtest/refleak.py
+++ b/Lib/test/libregrtest/refleak.py
@@ -44,13 +44,12 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
alloc_deltas = [0] * repcount
print("beginning", repcount, "repetitions", file=sys.stderr)
- print(("1234567890"*(repcount//10 + 1))[:repcount], file=sys.stderr)
- sys.stderr.flush()
+ print(("1234567890"*(repcount//10 + 1))[:repcount], file=sys.stderr,
+ flush=True)
for i in range(repcount):
indirect_test()
alloc_after, rc_after = dash_R_cleanup(fs, ps, pic, zdc, abcs)
- sys.stderr.write('.')
- sys.stderr.flush()
+ print('.', end='', flush=True)
if i >= nwarmup:
rc_deltas[i] = rc_after - rc_before
alloc_deltas[i] = alloc_after - alloc_before
@@ -74,8 +73,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
if checker(deltas):
msg = '%s leaked %s %s, sum=%s' % (
test, deltas[nwarmup:], item_name, sum(deltas))
- print(msg, file=sys.stderr)
- sys.stderr.flush()
+ print(msg, file=sys.stderr, flush=True)
with open(fname, "a") as refrep:
print(msg, file=refrep)
refrep.flush()