[Python-checkins] r43166 - python/trunk/Lib/ctypes/test/test_keeprefs.py

thomas.heller python-checkins at python.org
Mon Mar 20 09:11:58 CET 2006


Author: thomas.heller
Date: Mon Mar 20 09:11:56 2006
New Revision: 43166

Modified:
   python/trunk/Lib/ctypes/test/test_keeprefs.py
Log:
Plug a leak in the ctypes test suite when tests are run repeatedly.

Modified: python/trunk/Lib/ctypes/test/test_keeprefs.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_keeprefs.py	(original)
+++ python/trunk/Lib/ctypes/test/test_keeprefs.py	Mon Mar 20 09:11:56 2006
@@ -140,5 +140,10 @@
         r.a[0].x = 42
         r.a[0].y = 99
 
+        # to avoid leaking when tests are run several times
+        # clean up the types left in the cache.
+        from ctypes import _pointer_type_cache
+        del _pointer_type_cache[POINT]
+
 if __name__ == "__main__":
     unittest.main()


More information about the Python-checkins mailing list