summaryrefslogtreecommitdiffstats
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2010-03-17 02:02:30 (GMT)
committerCollin Winter <collinw@gmail.com>2010-03-17 02:02:30 (GMT)
commitac1d93167ce2e98a7cf6896526b3f961463962c6 (patch)
treec570053dd49e0d5d2c47dec10ab9b4ceb9334270 /Lib/test/regrtest.py
parent3436064785970d2464c66ec36924cbba0f8511e7 (diff)
downloadcpython-ac1d93167ce2e98a7cf6896526b3f961463962c6.zip
cpython-ac1d93167ce2e98a7cf6896526b3f961463962c6.tar.gz
cpython-ac1d93167ce2e98a7cf6896526b3f961463962c6.tar.bz2
Fix a trivial class of (hypothetical, future) false-positive refleaks, discovered by an optimization in Unladen Swallow's past (which will become CPython's future).
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 0f58208..6f08e80 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -993,12 +993,13 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
print >> sys.stderr, ("1234567890"*(repcount//10 + 1))[:repcount]
dash_R_cleanup(fs, ps, pic, zdc, abcs)
for i in range(repcount):
- rc = sys.gettotalrefcount()
+ rc_before = sys.gettotalrefcount()
run_the_test()
sys.stderr.write('.')
dash_R_cleanup(fs, ps, pic, zdc, abcs)
+ rc_after = sys.gettotalrefcount()
if i >= nwarmup:
- deltas.append(sys.gettotalrefcount() - rc - 2)
+ deltas.append(rc_after - rc_before)
print >> sys.stderr
if any(deltas):
msg = '%s leaked %s references, sum=%s' % (test, deltas, sum(deltas))