From 87d1c1d979abf8c6656aa38f4520ebe33642b4a4 Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Mon, 14 Nov 2022 14:44:51 +0100 Subject: [PATCH] Fix mypy --- scripts-dev/release.py | 4 +--- synapse/streams/events.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts-dev/release.py b/scripts-dev/release.py index c82c58c54b05..bf47b6c713ff 100755 --- a/scripts-dev/release.py +++ b/scripts-dev/release.py @@ -219,9 +219,7 @@ def _prepare() -> None: update_branch(repo) # Create the new release branch - # Type ignore will no longer be needed after GitPython 3.1.28. - # See https://github.com/gitpython-developers/GitPython/pull/1419 - repo.create_head(release_branch_name, commit=base_branch) # type: ignore[arg-type] + repo.create_head(release_branch_name, commit=base_branch) # Special-case SyTest: we don't actually prepare any files so we may # as well push it now (and only when we create a release branch; diff --git a/synapse/streams/events.py b/synapse/streams/events.py index bcd840bd88c1..bf91600c782b 100644 --- a/synapse/streams/events.py +++ b/synapse/streams/events.py @@ -45,9 +45,7 @@ def get_sources(self) -> Iterator[Tuple[str, EventSource]]: class EventSources: def __init__(self, hs: "HomeServer"): self.sources = _EventSourcesInner( - # mypy thinks attribute.type is `Optional`, but we know it's never `None` here since - # all the attributes of `_EventSourcesInner` are annotated. - *(attribute.type(hs) for attribute in attr.fields(_EventSourcesInner)) # type: ignore[misc] + *(attribute.type(hs) for attribute in attr.fields(_EventSourcesInner)) ) self.store = hs.get_datastores().main