mypy: Amend mention.py to ensure return of Set[Text].

This commit is contained in:
neiljp (Neil Pilgrim) 2017-09-24 16:16:07 -07:00 committed by Greg Price
parent e6daee441b
commit 4be2ada055
1 changed files with 2 additions and 2 deletions

View File

@ -28,6 +28,6 @@ def extract_name(s):
def possible_mentions(content):
# type: (Text) -> Set[Text]
matches = re.findall(find_mentions, content)
names = {extract_name(match) for match in matches}
names = {name for name in names if name}
names_with_none = {extract_name(match) for match in matches}
names = {name for name in names_with_none if name}
return names