Fix new flake8 errors (#7470)

This commit is contained in:
Erik Johnston 2020-05-12 11:20:48 +01:00 committed by GitHub
parent 8c8858e124
commit 1a1da60ad2
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)