diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-05 02:46:19 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-05 02:46:19 -0400 |
| commit | 0852c4534733db6427dc7f4d6b20798c8e3695e2 (patch) | |
| tree | e93be6d0a7650bb1756701c904509ca9c4b7ab0e /pkg_resources.py | |
| parent | 3d8a7a975f07b8497b2b8a8e4af98fe8aadfb053 (diff) | |
| download | python-setuptools-git-0852c4534733db6427dc7f4d6b20798c8e3695e2.tar.gz | |
Correct sort order by using list.sort with support for 'key' and 'reverse'. This method is less efficient, but allows the tests to pass.
Diffstat (limited to 'pkg_resources.py')
| -rw-r--r-- | pkg_resources.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 39805ad6..d9cff7c8 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -29,7 +29,6 @@ import token import symbol import operator import platform -import bisect from pkgutil import get_importer try: @@ -828,7 +827,8 @@ class Environment(object): if self.can_add(dist) and dist.has_version(): dists = self._distmap.setdefault(dist.key, []) if dist not in dists: - bisect.insort(dists, dist) + dists.append(dist) + dists.sort(key=operator.attrgetter('hashcmp'), reverse=True) def best_match(self, req, working_set, installer=None): """Find distribution best matching `req` and usable on `working_set` |
