Skip to content

Commit

Permalink
gh-116811: Ensure MetadataPathFinder.invalidate_caches is reachable w…
Browse files Browse the repository at this point in the history
…hen delegated through PathFinder. (python/cpython#116812)

* Make MetadataPathFinder a proper classmethod.
  • Loading branch information
jaraco committed Mar 20, 2024
1 parent b4ce0ff commit fb7465c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions importlib_metadata/__init__.py
Expand Up @@ -898,6 +898,7 @@ def _search_paths(cls, name, paths):
path.search(prepared) for path in map(FastPath, paths)
)

@classmethod
def invalidate_caches(cls) -> None:
FastPath.__new__.cache_clear()

Expand Down
1 change: 1 addition & 0 deletions newsfragments/+.bugfix.rst
@@ -0,0 +1 @@
Allow ``MetadataPathFinder.invalidate_caches`` to be called as a classmethod.

0 comments on commit fb7465c

Please sign in to comment.