mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-09 12:12:15 -04:00
Relax ignore-missing-imports
for modules that have stubs now and update mypy (#11006)
Updating mypy past version 0.9 means that third-party stubs are no-longer distributed with typeshed. See http://mypy-lang.blogspot.com/2021/06/mypy-0900-released.html for details. We therefore pull in stub packages in setup.py Additionally, some modules that we were previously ignoring import failures for now have stubs. So let's use them. The rest of this change consists of fixups to make the newer mypy + stubs pass CI. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
This commit is contained in:
parent
670a8d9a1e
commit
797ee7812d
12 changed files with 132 additions and 112 deletions
|
@ -51,7 +51,10 @@ def _handle_frozendict(obj: Any) -> Dict[Any, Any]:
|
|||
# fishing the protected dict out of the object is a bit nasty,
|
||||
# but we don't really want the overhead of copying the dict.
|
||||
try:
|
||||
return obj._dict
|
||||
# Safety: we catch the AttributeError immediately below.
|
||||
# See https://github.com/matrix-org/python-canonicaljson/issues/36#issuecomment-927816293
|
||||
# for discussion on how frozendict's internals have changed over time.
|
||||
return obj._dict # type: ignore[attr-defined]
|
||||
except AttributeError:
|
||||
# When the C implementation of frozendict is used,
|
||||
# there isn't a `_dict` attribute with a dict
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue