Skip to content

Commit 23ff3cb

Browse files
committed
Allow 'dists' to be any iterable. Closes #122.
1 parent f452ac5 commit 23ff3cb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

importlib_metadata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def from_name(cls, name):
199199
"""
200200
for resolver in cls._discover_resolvers():
201201
dists = resolver(DistributionFinder.Context(name=name))
202-
dist = next(dists, None)
202+
dist = next(iter(dists), None)
203203
if dist is not None:
204204
return dist
205205
else:

importlib_metadata/docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ v1.6.1
1313
* Ensure inputs to FastPath are Unicode. Closes #121.
1414
* Tests now rely on ``importlib.resources.files`` (and
1515
backport) instead of the older ``path`` function.
16+
* Support any iterable from ``find_distributions``.
17+
Closes #122.
1618

1719
v1.6.0
1820
======

0 commit comments

Comments
 (0)