mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-25 08:09:23 -05:00
fix recursion error
This commit is contained in:
parent
dd068ca979
commit
4ee4450d66
@ -19,14 +19,13 @@ import simplejson as json
|
||||
from six import string_types
|
||||
|
||||
def freeze(o):
|
||||
t = type(o)
|
||||
if t is dict:
|
||||
if isinstance(o, dict):
|
||||
return frozendict({k: freeze(v) for k, v in o.items()})
|
||||
|
||||
if t is frozendict:
|
||||
if isinstance(o, frozendict):
|
||||
return o
|
||||
|
||||
if isinstance(t, string_types):
|
||||
if isinstance(o, string_types):
|
||||
return o
|
||||
|
||||
try:
|
||||
@ -38,11 +37,10 @@ def freeze(o):
|
||||
|
||||
|
||||
def unfreeze(o):
|
||||
t = type(o)
|
||||
if t is dict or t is frozendict:
|
||||
if isinstance(o, (dict, frozendict)):
|
||||
return dict({k: unfreeze(v) for k, v in o.items()})
|
||||
|
||||
if isinstance(t, string_types):
|
||||
if isinstance(o, string_types):
|
||||
return o
|
||||
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user