use set() to remove any duplicates in patterns

This commit is contained in:
Jan Petykiewicz 2020-05-23 19:38:17 -07:00
parent e401f37993
commit 09615eaea6

View File

@ -498,7 +498,7 @@ def disambiguate_pattern_names(patterns: Sequence[Pattern],
be displayed. Default displays all warnings. be displayed. Default displays all warnings.
""" """
used_names = [] used_names = []
for pat in patterns: for pat in set(patterns):
# Shorten names which already exceed max-length # Shorten names which already exceed max-length
if len(pat.name) > max_name_length: if len(pat.name) > max_name_length:
shortened_name = pat.name[:max_name_length - suffix_length] shortened_name = pat.name[:max_name_length - suffix_length]