From: Raymond Hettinger Date: Fri, 2 May 2003 22:44:59 +0000 (+0000) Subject: Simplify ref count test. X-Git-Tag: v2.3c1~889 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=320a1b04543a8fa7c32227f4db18238ad84ce2ae;p=python Simplify ref count test. --- diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 50bf00b72c..8929094c96 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -283,10 +283,10 @@ def test_main(verbose=None): # verify reference counting import sys if verbose and hasattr(sys, "gettotalrefcount"): - counts = [] - for i in xrange(5): + counts = [None] * 5 + for i in xrange(len(counts)): test_support.run_suite(suite) - counts.append(sys.gettotalrefcount()-i) + counts[i] = sys.gettotalrefcount() print counts if __name__ == "__main__":