Skip to content

Commit

Permalink
Make MetadataPathFinder.find_distributions a classmethod for consiste…
Browse files Browse the repository at this point in the history
…ncy with CPython. Closes #484.
  • Loading branch information
jaraco committed Mar 20, 2024
1 parent adc4b12 commit 47b14ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions importlib_metadata/__init__.py
Expand Up @@ -877,8 +877,9 @@ class MetadataPathFinder(NullFinder, DistributionFinder):
of Python that do not have a PathFinder find_distributions().
"""

@classmethod
def find_distributions(
self, context=DistributionFinder.Context()
cls, context=DistributionFinder.Context()
) -> Iterable[PathDistribution]:
"""
Find distributions.
Expand All @@ -888,7 +889,7 @@ def find_distributions(
(or all names if ``None`` indicated) along the paths in the list
of directories ``context.path``.
"""
found = self._search_paths(context.name, context.path)
found = cls._search_paths(context.name, context.path)
return map(PathDistribution, found)

@classmethod
Expand Down
1 change: 1 addition & 0 deletions newsfragments/484.bugfix.rst
@@ -0,0 +1 @@
Make MetadataPathFinder.find_distributions a classmethod for consistency with CPython. Closes #484.

0 comments on commit 47b14ac

Please sign in to comment.