diff options
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` |
