Issue #13380: add an internal function for resetting the ctypes caches

This commit is contained in:
Meador Inge 2011-11-25 22:37:44 -06:00
commit 4bc45b7a9f
4 changed files with 25 additions and 9 deletions

View file

@ -1401,6 +1401,13 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
filecmp._cache.clear()
struct._clearcache()
doctest.master = None
try:
import ctypes
except ImportError:
# Don't worry about resetting the cache if ctypes is not supported
pass
else:
ctypes._reset_cache()
# Collect cyclic trash.
gc.collect()