MCPcopy Index your code
hub / github.com/RustPython/RustPython / invalidate_caches

Method invalidate_caches

Lib/importlib/_bootstrap_external.py:1203–1218  ·  view source on GitHub ↗

Call the invalidate_caches() method on all path entry finders stored in sys.path_importer_cache (where implemented).

()

Source from the content-addressed store, hash-verified

1201
1202 @staticmethod
1203 def invalidate_caches():
1204 """Call the invalidate_caches() method on all path entry finders
1205 stored in sys.path_importer_cache (where implemented)."""
1206 for name, finder in list(sys.path_importer_cache.items()):
1207 # Drop entry if finder name is a relative path. The current
1208 # working directory may have changed.
1209 if finder is None or not _path_isabs(name):
1210 del sys.path_importer_cache[name]
1211 elif hasattr(finder, 'invalidate_caches'):
1212 finder.invalidate_caches()
1213 # Also invalidate the caches of _NamespacePaths
1214 # https://bugs.python.org/issue45703
1215 _NamespacePath._epoch += 1
1216
1217 from importlib.metadata import MetadataPathFinder
1218 MetadataPathFinder.invalidate_caches()
1219
1220 @staticmethod
1221 def _path_hooks(path):

Callers

nothing calls this directly

Calls 4

listClass · 0.85
hasattrFunction · 0.85
_path_isabsFunction · 0.70
itemsMethod · 0.45

Tested by

no test coverage detected