Return strings instead of null

This commit is contained in:
Andy Neff 2017-02-22 10:13:44 -05:00
parent 8383e40216
commit 3f5c1425bc

View File

@ -59,11 +59,11 @@ class JSONEncoder(json.JSONEncoder):
# internals.
if o != o:
text = 'null'
text = '"NaN"'
elif o == _inf:
text = 'null'
text = '"Infinity"'
elif o == _neginf:
text = 'null'
text = '"-Infinity"'
else:
return _repr(o)