mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Plug a leak in the ctypes test suite when tests are run repeatedly.
This commit is contained in:
parent
d59ca8f335
commit
cce2267cf1
1 changed files with 5 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue