|
3 | 3 | import sys |
4 | 4 | import unittest |
5 | 5 | from ctypes import (CDLL, CFUNCTYPE, Structure, |
6 | | - POINTER, pointer, _Pointer, _pointer_type_cache, |
| 6 | + POINTER, pointer, _Pointer, |
7 | 7 | byref, sizeof, |
8 | 8 | c_void_p, c_char_p, |
9 | 9 | c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, |
@@ -141,8 +141,6 @@ class Table(Structure): |
141 | 141 |
|
142 | 142 | pt.contents.c = 33 |
143 | 143 |
|
144 | | - del _pointer_type_cache[Table] |
145 | | - |
146 | 144 | def test_basic(self): |
147 | 145 | p = pointer(c_int(42)) |
148 | 146 | # Although a pointer can be indexed, it has no length |
@@ -210,17 +208,11 @@ def test_pointer_type_name(self): |
210 | 208 | LargeNamedType = type('T' * 2 ** 25, (Structure,), {}) |
211 | 209 | self.assertTrue(POINTER(LargeNamedType)) |
212 | 210 |
|
213 | | - # to not leak references, we must clean _pointer_type_cache |
214 | | - del _pointer_type_cache[LargeNamedType] |
215 | | - |
216 | 211 | def test_pointer_type_str_name(self): |
217 | 212 | large_string = 'T' * 2 ** 25 |
218 | 213 | P = POINTER(large_string) |
219 | 214 | self.assertTrue(P) |
220 | 215 |
|
221 | | - # to not leak references, we must clean _pointer_type_cache |
222 | | - del _pointer_type_cache[id(P)] |
223 | | - |
224 | 216 | def test_abstract(self): |
225 | 217 | self.assertRaises(TypeError, _Pointer.set_type, 42) |
226 | 218 |
|
|
0 commit comments