We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a1d9d4 commit 2b63dcfCopy full SHA for 2b63dcf
snippets/pyaloha/protocol.py
@@ -145,7 +145,8 @@ class CustomEncoder(json.JSONEncoder):
145
def default(self, obj):
146
if hasattr(obj, '__dumpdict__'):
147
return obj.__dumpdict__()
148
- if isinstance(obj, bytes):
+ if not isinstance(obj, str) and isinstance(obj, bytes):
149
+ # in python 2.7 str is bytes; don't decode it
150
return obj.decode()
151
# Let the base class default method raise the TypeError
152
return super(CustomEncoder, self).default(obj)
0 commit comments