Python code coverage for Lib/test/leakers/test_ctypes.py
# | count | content |
---|---|---|
1 | n/a | |
2 | n/a | # Taken from Lib/ctypes/test/test_keeprefs.py, PointerToStructure.test(). |
3 | n/a | |
4 | n/a | from ctypes import Structure, c_int, POINTER |
5 | n/a | import gc |
6 | n/a | |
7 | n/a | def leak_inner(): |
8 | n/a | class POINT(Structure): |
9 | n/a | _fields_ = [("x", c_int)] |
10 | n/a | class RECT(Structure): |
11 | n/a | _fields_ = [("a", POINTER(POINT))] |
12 | n/a | |
13 | n/a | def leak(): |
14 | n/a | leak_inner() |
15 | n/a | gc.collect() |