Call the invalidate_caches() method on all path entry finders stored in sys.path_importer_cache (where implemented).
()
| 1179 | |
| 1180 | @staticmethod |
| 1181 | def invalidate_caches(): |
| 1182 | """Call the invalidate_caches() method on all path entry finders |
| 1183 | stored in sys.path_importer_cache (where implemented).""" |
| 1184 | for name, finder in list(sys.path_importer_cache.items()): |
| 1185 | # Drop entry if finder name is a relative path. The current |
| 1186 | # working directory may have changed. |
| 1187 | if finder is None or not _path_isabs(name): |
| 1188 | del sys.path_importer_cache[name] |
| 1189 | elif hasattr(finder, 'invalidate_caches'): |
| 1190 | finder.invalidate_caches() |
| 1191 | # Also invalidate the caches of NamespacePaths |
| 1192 | # https://bugs.python.org/issue45703 |
| 1193 | NamespacePath._epoch += 1 |
| 1194 | |
| 1195 | from importlib.metadata import MetadataPathFinder |
| 1196 | MetadataPathFinder.invalidate_caches() |
| 1197 | |
| 1198 | @staticmethod |
| 1199 | def _path_hooks(path): |
nothing calls this directly
no test coverage detected