[Python-checkins] r83403 - python/branches/py3k/Lib/test/test_struct.py

mark.dickinson python-checkins at python.org
Sun Aug 1 13:10:28 CEST 2010


Author: mark.dickinson
Date: Sun Aug  1 13:10:28 2010
New Revision: 83403

Log:
Add test for memory leak reported in issue 9422.

Modified:
   python/branches/py3k/Lib/test/test_struct.py

Modified: python/branches/py3k/Lib/test/test_struct.py
==============================================================================
--- python/branches/py3k/Lib/test/test_struct.py	(original)
+++ python/branches/py3k/Lib/test/test_struct.py	Sun Aug  1 13:10:28 2010
@@ -560,7 +560,12 @@
                           'spam and eggs')
         self.assertRaises(struct.error, struct.unpack_from, '14s42', store, 0)
 
-
+    def test_Struct_reinitialization(self):
+        # Issue 9422: there was a memory leak when reinitializing a
+        # Struct instance.  This test can be used to detect the leak
+        # when running with regrtest -L.
+        s = struct.Struct('i')
+        s.__init__('ii')
 
 def test_main():
     run_unittest(StructTest)


More information about the Python-checkins mailing list