PageRenderTime 243ms CodeModel.GetById 151ms app.highlight 2ms RepoModel.GetById 89ms app.codeStats 0ms

/Lib/test/leakers/test_ctypes.py

http://unladen-swallow.googlecode.com/
Python | 16 lines | 10 code | 4 blank | 2 comment | 0 complexity | a1bfd5faab4ee8be5de1e146c50c4c30 MD5 | raw file
 1
 2# Taken from Lib/ctypes/test/test_keeprefs.py, PointerToStructure.test().
 3# When this leak is fixed, remember to remove from Misc/build.sh LEAKY_TESTS.
 4
 5from ctypes import Structure, c_int, POINTER
 6import gc
 7
 8def leak_inner():
 9    class POINT(Structure):
10        _fields_ = [("x", c_int)]
11    class RECT(Structure):
12        _fields_ = [("a", POINTER(POINT))]
13
14def leak():
15    leak_inner()
16    gc.collect()