Skip to content

Commit 4257e06

Browse files
burivuhjbenua
authored andcommitted
review fixes
1 parent 07254c0 commit 4257e06

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

snippets/pyaloha/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__="0.1.2"
1+
__version__="0.1.3"

snippets/pyaloha/protocol.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,17 @@ def custom_loads(dct):
156156

157157
class CustomEncoder(json.JSONEncoder):
158158
def default(self, obj):
159-
if not isinstance(obj, str) and isinstance(obj, bytes):
160-
# in python 2.7 str is bytes; don't decode it
161-
return obj.decode()
162-
163159
if hasattr(obj, '__dumpdict__'):
164160
obj = obj.__dumpdict__()
165161

166162
if isinstance(obj, dict):
167163
# process json unprocessable dict keys
168164
return decode_keys_for_json(obj)
169165

166+
if not isinstance(obj, str) and isinstance(obj, bytes):
167+
# in python 2.7 str is bytes; don't decode it
168+
return obj.decode()
169+
170170
# Let the base class default method raise the TypeError
171171
return super(CustomEncoder, self).default(obj)
172172

0 commit comments

Comments
 (0)