diff options
author | Meador Inge <meadori@gmail.com> | 2011-11-26 04:33:32 (GMT) |
---|---|---|
committer | Meador Inge <meadori@gmail.com> | 2011-11-26 04:33:32 (GMT) |
commit | 11e381310bb5f498186098855f843c2e07e7ea82 (patch) | |
tree | 70533ac58fb9900b4098819f3b3ae85726175c38 /Lib/test/regrtest.py | |
parent | 4558bad7d64a7599b46fb56ea2df52319437f3a0 (diff) | |
download | cpython-11e381310bb5f498186098855f843c2e07e7ea82.zip cpython-11e381310bb5f498186098855f843c2e07e7ea82.tar.gz cpython-11e381310bb5f498186098855f843c2e07e7ea82.tar.bz2 |
Issue #13380: add an internal function for resetting the ctypes caches
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-x | Lib/test/regrtest.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 10b515b..cbbf1ca 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -1255,6 +1255,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() |