Fix new flake8 errors (#7489)

This is a cherry-pick of 1a1da60ad2 (#7470)
to the release-v1.13.0 branch.
This commit is contained in:
Patrick Cloke 2020-05-13 08:24:50 -04:00 committed by GitHub
parent fa4af2c3af
commit edd3b0747c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 12 deletions

View file

@ -19,6 +19,7 @@ import logging
import time
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from typing import Iterable, List, TypeVar
from six.moves import urllib
@ -41,6 +42,8 @@ from synapse.visibility import filter_events_for_client
logger = logging.getLogger(__name__)
T = TypeVar("T")
MESSAGE_FROM_PERSON_IN_ROOM = (
"You have a message on %(app)s from %(person)s in the %(room)s room..."
@ -638,10 +641,10 @@ def safe_text(raw_text):
)
def deduped_ordered_list(l):
def deduped_ordered_list(it: Iterable[T]) -> List[T]:
seen = set()
ret = []
for item in l:
for item in it:
if item not in seen:
seen.add(item)
ret.append(item)