File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed
Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -178,8 +178,7 @@ def from_name(cls, name):
178178 metadata cannot be found.
179179 """
180180 for resolver in cls ._discover_resolvers ():
181- context = DistributionFinder .Context (name = name )
182- dists = cls ._maybe_bind (resolver , context )
181+ dists = resolver (DistributionFinder .Context (name = name ))
183182 dist = next (dists , None )
184183 if dist is not None :
185184 return dist
@@ -201,24 +200,10 @@ def discover(cls, **kwargs):
201200 raise ValueError ("cannot accept context and kwargs" )
202201 context = context or DistributionFinder .Context (** kwargs )
203202 return itertools .chain .from_iterable (
204- cls . _maybe_bind ( resolver , context )
203+ resolver ( context )
205204 for resolver in cls ._discover_resolvers ()
206205 )
207206
208- @staticmethod
209- def _maybe_bind (resolver , context ):
210- """
211- Only bind the context to the resolver if as a callable,
212- the resolver accepts the context parameter.
213-
214- Workaround for
215- https://gitlab.com/python-devs/importlib_metadata/issues/86
216- """
217- try : # pragma: nocover
218- return resolver (context )
219- except TypeError : # pragma: nocover
220- return resolver (name = context .name , path = context .path )
221-
222207 @staticmethod
223208 def at (path ):
224209 """Return a Distribution for the indicated metadata path
You can’t perform that action at this time.
0 commit comments