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

This commit is contained in:
Meador Inge 2011-11-25 22:25:06 -06:00
parent a5d5bb997b
commit 0e30317891
4 changed files with 26 additions and 11 deletions

View file

@ -1076,6 +1076,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()