utils.sort_domains wasn't right

This commit is contained in:
Joshua Tauberer 2014-07-09 12:35:12 +00:00
parent 1a74b81f44
commit deebda06e1
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ def sort_domains(domain_names, env):
# Within each group, sort parent domains before subdomains and after that sort lexicographically.
def sort_group(group):
# Find the top-most domains.
top_domains = sorted(d for d in group if len([s for s in group if s.startswith("." + d)]) == 0)
top_domains = sorted(d for d in group if len([s for s in group if d.endswith("." + s)]) == 0)
ret = []
for d in top_domains:
ret.append(d)