]> granicus.if.org Git - python/commitdiff
Simplify ref count test.
authorRaymond Hettinger <python@rcn.com>
Fri, 2 May 2003 22:44:59 +0000 (22:44 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 2 May 2003 22:44:59 +0000 (22:44 +0000)
Lib/test/test_random.py

index 50bf00b72cdc745a400aa0fe3f93672fcaa21746..8929094c96aec2dabf850d98f1915bd22c53fd2a 100644 (file)
@@ -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__":