diff --git a/changelog.d/19876.misc b/changelog.d/19876.misc new file mode 100644 index 00000000000..694b5ddddee --- /dev/null +++ b/changelog.d/19876.misc @@ -0,0 +1 @@ +Prevent an obtuse error masking a more user-friendly error when trying to run Synapse with an outdated rust module in certain cases. \ No newline at end of file diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py index 977a662d7a5..6b059c6b0e1 100644 --- a/synapse/util/__init__.py +++ b/synapse/util/__init__.py @@ -38,10 +38,8 @@ from twisted.internet import defer from twisted.python.failure import Failure -from synapse.types import JsonDict - if typing.TYPE_CHECKING: - pass + from synapse.types import JsonDict logger = logging.getLogger(__name__) @@ -189,7 +187,7 @@ def split_dict_to_fit_to_size( *, soft_max_size: int, wrapping_object_size: int = 2, -) -> Iterator[tuple[dict[str, JsonDict], int]]: +) -> Iterator[tuple[dict[str, "JsonDict"], int]]: """Splits a dict up into a list of dicts, each of which is small enough to fit into the given size when encoded as JSON. Every entry in the original dict is in exactly one of the resulting dicts.