Call the invalidate_caches() method on all path entry finders stored in sys.path_importer_cache (where implemented).
()
| 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): |
nothing calls this directly
no test coverage detected