Update mypy to 0.950 and fix complaints (#12650)

This commit is contained in:
David Robertson 2022-05-06 13:35:20 +01:00 committed by GitHub
parent c2d50e9f6c
commit 2607b3e181
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 98 additions and 57 deletions

View file

@ -1427,7 +1427,7 @@ class EventCreationHandler:
# Validate a newly added alias or newly added alt_aliases.
original_alias = None
original_alt_aliases: List[str] = []
original_alt_aliases: object = []
original_event_id = event.unsigned.get("replaces_state")
if original_event_id:
@ -1455,6 +1455,7 @@ class EventCreationHandler:
# If the old version of alt_aliases is of an unknown form,
# completely replace it.
if not isinstance(original_alt_aliases, (list, tuple)):
# TODO: check that the original_alt_aliases' entries are all strings
original_alt_aliases = []
# Check that each alias is currently valid.