File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- __version__ = "0.1.2 "
1+ __version__ = "0.1.3 "
Original file line number Diff line number Diff line change @@ -156,17 +156,17 @@ def custom_loads(dct):
156156
157157class 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
You can’t perform that action at this time.
0 commit comments