Author: guido.van.rossum
Date: Tue Nov  6 01:40:49 2007
New Revision: 58871

Modified:
   python/branches/py3k-pep3137/Lib/test/test_struct.py
Log:
Fix the "leak" in test_struct.  It was just being the character cache
being filled ever so slowly with random characters.
(There are an amazing number of places that don't use the character
cache, BTW.)


Modified: python/branches/py3k-pep3137/Lib/test/test_struct.py
==============================================================================
--- python/branches/py3k-pep3137/Lib/test/test_struct.py        (original)
+++ python/branches/py3k-pep3137/Lib/test/test_struct.py        Tue Nov  6 
01:40:49 2007
@@ -414,6 +414,11 @@
                 for badobject in "a string", 3+42j, randrange:
                     any_err(struct.pack, direction + code, badobject)
 
+# Warm the character cache
+s = bytes(range(256))
+for i in range(256):
+    s[i:i+1]
+
 for args in [("bB", 1),
              ("hH", 2),
              ("iI", 4),
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to