File tree Expand file tree Collapse file tree 2 files changed +5
-17
lines changed
Expand file tree Collapse file tree 2 files changed +5
-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
Original file line number Diff line number Diff line change 44
55v1.0.0
66======
7+
8+ * Removed compatibility shim introduced in 0.23.
9+
710* For better compatibility with the stdlib implementation and to
811 avoid the same distributions being discovered by the stdlib and
912 backport implementations, the backport now disables the
You can’t perform that action at this time.
0 commit comments