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

Commit bdad0e9

Browse files
dependabot[bot]erikjohnston
authored andcommitted
Bump twisted from 22.10.0 to 23.8.0 (#16235)
* Bump twisted from 22.10.0 to 23.8.0 Bumps [twisted](https://github.com/twisted/twisted) from 22.10.0 to 23.8.0. - [Release notes](https://github.com/twisted/twisted/releases) - [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst) - [Commits](twisted/twisted@twisted-22.10.0...twisted-23.8.0) --- updated-dependencies: - dependency-name: twisted dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Fix types * Fix lint * Newsfile --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Erik Johnston <[email protected]>
1 parent d77154b commit bdad0e9

File tree

5 files changed

+24
-28
lines changed

5 files changed

+24
-28
lines changed

changelog.d/16235.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix type checking when using the new version of Twisted.

poetry.lock

Lines changed: 18 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

synapse/handlers/initial_sync.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
import logging
16-
from typing import TYPE_CHECKING, List, Optional, Tuple, cast
16+
from typing import TYPE_CHECKING, List, Optional, Tuple
1717

1818
from synapse.api.constants import (
1919
AccountDataTypes,
@@ -23,7 +23,6 @@
2323
Membership,
2424
)
2525
from synapse.api.errors import SynapseError
26-
from synapse.events import EventBase
2726
from synapse.events.utils import SerializeEventConfig
2827
from synapse.events.validator import EventValidator
2928
from synapse.handlers.presence import format_user_presence_state
@@ -35,7 +34,6 @@
3534
JsonDict,
3635
Requester,
3736
RoomStreamToken,
38-
StateMap,
3937
StreamKeyType,
4038
StreamToken,
4139
UserID,
@@ -199,9 +197,7 @@ async def handle_room(event: RoomsForUser) -> None:
199197
deferred_room_state = run_in_background(
200198
self._state_storage_controller.get_state_for_events,
201199
[event.event_id],
202-
).addCallback(
203-
lambda states: cast(StateMap[EventBase], states[event.event_id])
204-
)
200+
).addCallback(lambda states: states[event.event_id])
205201

206202
(messages, token), current_state = await make_deferred_yieldable(
207203
gather_results(

synapse/logging/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ async def _unwrap_awaitable(awaitable: Awaitable[R]) -> R:
728728

729729

730730
@overload
731-
def preserve_fn( # type: ignore[misc]
731+
def preserve_fn(
732732
f: Callable[P, Awaitable[R]],
733733
) -> Callable[P, "defer.Deferred[R]"]:
734734
# The `type: ignore[misc]` above suppresses
@@ -756,7 +756,7 @@ def g(*args: P.args, **kwargs: P.kwargs) -> "defer.Deferred[R]":
756756

757757

758758
@overload
759-
def run_in_background( # type: ignore[misc]
759+
def run_in_background(
760760
f: Callable[P, Awaitable[R]], *args: P.args, **kwargs: P.kwargs
761761
) -> "defer.Deferred[R]":
762762
# The `type: ignore[misc]` above suppresses

synapse/util/gai_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def __init__(
136136

137137
# The types on IHostnameResolver is incorrect in Twisted, see
138138
# https://twistedmatrix.com/trac/ticket/10276
139-
def resolveHostName( # type: ignore[override]
139+
def resolveHostName(
140140
self,
141141
resolutionReceiver: IResolutionReceiver,
142142
hostName: str,

0 commit comments

Comments
 (0)