summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/libregrtest/utils.py')
-rw-r--r--Lib/test/libregrtest/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py
index 7765ae8..837f73b 100644
--- a/Lib/test/libregrtest/utils.py
+++ b/Lib/test/libregrtest/utils.py
@@ -276,6 +276,15 @@ def clear_caches():
pass
else:
inspect._shadowed_dict_from_mro_tuple.cache_clear()
+ inspect._filesbymodname.clear()
+ inspect.modulesbyfile.clear()
+
+ try:
+ importlib_metadata = sys.modules['importlib.metadata']
+ except KeyError:
+ pass
+ else:
+ importlib_metadata.FastPath.__new__.cache_clear()
def get_build_info():