summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-03-20 08:11:56 (GMT)
committerThomas Heller <theller@ctypes.org>2006-03-20 08:11:56 (GMT)
commitcce2267cf117e634e4ff307ca9339075e79bdee9 (patch)
treeceea48f8f9807afddde754dd38ba26f4dae6b95f /Lib
parentd59ca8f335282ca72896c936d862a9a68633d73f (diff)
downloadcpython-cce2267cf117e634e4ff307ca9339075e79bdee9.zip
cpython-cce2267cf117e634e4ff307ca9339075e79bdee9.tar.gz
cpython-cce2267cf117e634e4ff307ca9339075e79bdee9.tar.bz2
Plug a leak in the ctypes test suite when tests are run repeatedly.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/test_keeprefs.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_keeprefs.py b/Lib/ctypes/test/test_keeprefs.py
index 39e70e3..7318f29 100644
--- a/Lib/ctypes/test/test_keeprefs.py
+++ b/Lib/ctypes/test/test_keeprefs.py
@@ -140,5 +140,10 @@ class PointerToStructure(unittest.TestCase):
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()