Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 2cc5925

Browse files
author
David Robertson
authored
Remove unused type-ignores (#14433)
* Remove unused type-ignores Oversights in #14427 and #14429. * Changelog
1 parent fb66fae commit 2cc5925

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

changelog.d/14433.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix mypy errors introduced by bumping the locked version of `attrs` and `gitpython`.

scripts-dev/release.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ def _prepare() -> None:
219219
update_branch(repo)
220220

221221
# Create the new release branch
222-
# Type ignore will no longer be needed after GitPython 3.1.28.
223-
# See https://github.com/gitpython-developers/GitPython/pull/1419
224-
repo.create_head(release_branch_name, commit=base_branch) # type: ignore[arg-type]
222+
repo.create_head(release_branch_name, commit=base_branch)
225223

226224
# Special-case SyTest: we don't actually prepare any files so we may
227225
# as well push it now (and only when we create a release branch;

synapse/streams/events.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ def get_sources(self) -> Iterator[Tuple[str, EventSource]]:
4545
class EventSources:
4646
def __init__(self, hs: "HomeServer"):
4747
self.sources = _EventSourcesInner(
48-
# mypy thinks attribute.type is `Optional`, but we know it's never `None` here since
49-
# all the attributes of `_EventSourcesInner` are annotated.
50-
*(attribute.type(hs) for attribute in attr.fields(_EventSourcesInner)) # type: ignore[misc]
48+
# mypy previously warned that attribute.type is `Optional`, but we know it's
49+
# never `None` here since all the attributes of `_EventSourcesInner` are
50+
# annotated.
51+
# As of the stubs in attrs 22.1.0, `attr.fields()` now returns Any,
52+
# so the call to `attribute.type` is not checked.
53+
*(attribute.type(hs) for attribute in attr.fields(_EventSourcesInner))
5154
)
5255
self.store = hs.get_datastores().main
5356

0 commit comments

Comments
 (0)