diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-11 17:10:22 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-11 17:10:22 +0000 |
commit | 54fdbc7e50dfdd80eda563536d08bdfef079937c (patch) | |
tree | 9d28877f14b914af743629010be54a01477ffddc /synapse/util | |
parent | Allow newer versions of syutil (diff) | |
parent | Bump syutil version (diff) | |
download | synapse-54fdbc7e50dfdd80eda563536d08bdfef079937c.tar.xz |
Merge pull request #66 from matrix-org/use-simplejson
Use simplejson
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/frozenutils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/util/frozenutils.py b/synapse/util/frozenutils.py index a13a2015e4..9e10d37aec 100644 --- a/synapse/util/frozenutils.py +++ b/synapse/util/frozenutils.py @@ -21,6 +21,9 @@ def freeze(o): if t is dict: return frozendict({k: freeze(v) for k, v in o.items()}) + if t is frozendict: + return o + if t is str or t is unicode: return o @@ -33,10 +36,11 @@ def freeze(o): def unfreeze(o): - if isinstance(o, frozendict) or isinstance(o, dict): + t = type(o) + if t is dict or t is frozendict: return dict({k: unfreeze(v) for k, v in o.items()}) - if isinstance(o, basestring): + if t is str or t is unicode: return o try: |