mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
gh-116731: libregrtest: Clear inspect & importlib.metadata caches in clear_caches (GH-116805)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
This commit is contained in:
parent
846ad5a26a
commit
bae6579b46
1 changed files with 9 additions and 0 deletions
|
|
@ -276,6 +276,15 @@ def clear_caches():
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
inspect._shadowed_dict_from_mro_tuple.cache_clear()
|
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():
|
def get_build_info():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue