Skip to content
Snippets Groups Projects
Commit f625396d13bc authored by Bob Ippolito's avatar Bob Ippolito
Browse files

1.0 vs. infinity patch for Win32

git-svn-id: http://simplejson.googlecode.com/svn/trunk@33 a4795897-2c25-0410-b006-0d3caba88fa1
parent 979b862b87d2
Branches
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
'\r': '\\r', '\r': '\\r',
'\t': '\\t', '\t': '\\t',
} }
for i in range(20): for i in range(0x20):
ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,)) ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,))
def floatstr(o, allow_nan=True): def floatstr(o, allow_nan=True):
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
if o != o: if o != o:
text = 'NaN' text = 'NaN'
elif o == 1.0:
assert o != INFINITY
return '1.0'
elif o == INFINITY: elif o == INFINITY:
text = 'Infinity' text = 'Infinity'
elif o == -INFINITY: elif o == -INFINITY:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment