* Make MetadataPathFinder a proper classmethod.
* In PathFinder.invalidate_caches, also invoke MetadataPathFinder.invalidate_caches.
* Add blurb
(cherry picked from commit
5f52d20a93908196f74271db8437cc1ba7e1e262)
# https://bugs.python.org/issue45703
_NamespacePath._epoch += 1
+ from importlib.metadata import MetadataPathFinder
+ MetadataPathFinder.invalidate_caches()
+
@staticmethod
def _path_hooks(path):
"""Search sys.path_hooks for a finder for 'path'."""
path.search(prepared) for path in map(FastPath, paths)
)
+ @classmethod
def invalidate_caches(cls):
FastPath.__new__.cache_clear()
--- /dev/null
+In ``PathFinder.invalidate_caches``, delegate to
+``MetadataPathFinder.invalidate_caches``.