Skip to content

Commit ae2a07f

Browse files
committed
Update json_to_py
1 parent 215c4f6 commit ae2a07f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/createsend/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ def connect(self):
107107
raise
108108

109109

110-
def json_to_py(j):
111-
o = json.loads(j.decode('utf-8'))
110+
def json_to_py(o):
111+
if isinstance(o,bytes):
112+
o = json.loads(o.decode('utf-8'))
112113
if isinstance(o, dict):
113114
return dict_to_object(o)
114115
else:

0 commit comments

Comments
 (0)