Skip to content

Commit fb7465c

Browse files
committed
gh-116811: Ensure MetadataPathFinder.invalidate_caches is reachable when delegated through PathFinder. (python/cpython#116812)
* Make MetadataPathFinder a proper classmethod.
1 parent b4ce0ff commit fb7465c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

importlib_metadata/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ def _search_paths(cls, name, paths):
898898
path.search(prepared) for path in map(FastPath, paths)
899899
)
900900

901+
@classmethod
901902
def invalidate_caches(cls) -> None:
902903
FastPath.__new__.cache_clear()
903904

newsfragments/+.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Allow ``MetadataPathFinder.invalidate_caches`` to be called as a classmethod.

0 commit comments

Comments
 (0)