diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-04-27 09:00:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-27 09:00:07 -0400 |
commit | 8a23bde82352f18d7d6f098e3f3f0ce7099efb86 (patch) | |
tree | 69f616cbc1b195490d8c82650db705fc5ea9bfc7 /synapse/util/frozenutils.py | |
parent | Add option to enable token registration without requiring 3pids (#12526) (diff) | |
download | synapse-8a23bde82352f18d7d6f098e3f3f0ce7099efb86.tar.xz |
Consistently use collections.abc.Mapping to check frozendict. (#12564)
Diffstat (limited to 'synapse/util/frozenutils.py')
-rw-r--r-- | synapse/util/frozenutils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/util/frozenutils.py b/synapse/util/frozenutils.py index 9c405eb4d7..7223af1a36 100644 --- a/synapse/util/frozenutils.py +++ b/synapse/util/frozenutils.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import collections.abc from typing import Any from frozendict import frozendict @@ -35,7 +36,7 @@ def freeze(o: Any) -> Any: def unfreeze(o: Any) -> Any: - if isinstance(o, (dict, frozendict)): + if isinstance(o, collections.abc.Mapping): return {k: unfreeze(v) for k, v in o.items()} if isinstance(o, (bytes, str)): |