Fix concretize bug where provider sort couldn't handle version ranges

This commit is contained in:
Matthew LeGendre 2016-10-21 11:59:41 -07:00
parent 9f36ae4e20
commit 73b46a92bc

View File

@ -95,7 +95,11 @@ def cmp_externals(a, b):
not b.external and b.external_module):
# We're choosing between different providers, so
# maintain order from provider sort
return candidates.index(a) - candidates.index(b)
index_of_a = next(i for i in range(0, len(candidates)) \
if a.satisfies(candidates[i]))
index_of_b = next(i for i in range(0, len(candidates)) \
if b.satisfies(candidates[i]))
return index_of_a - index_of_b
result = cmp_specs(a, b)
if result != 0: