Skip to content

Commit

Permalink
1.0 vs. infinity patch for Win32
Browse files Browse the repository at this point in the history
git-svn-id: http://simplejson.googlecode.com/svn/trunk@33 a4795897-2c25-0410-b006-0d3caba88fa1
  • Loading branch information
etrepum committed Nov 30, 2006
1 parent f283cce commit 905f275
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion simplejson/encoder.py
Expand Up @@ -16,7 +16,7 @@
'\r': '\\r',
'\t': '\\t',
}
for i in range(20):
for i in range(0x20):
ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,))

def floatstr(o, allow_nan=True):
Expand All @@ -28,6 +28,9 @@ def floatstr(o, allow_nan=True):

if o != o:
text = 'NaN'
elif o == 1.0:
assert o != INFINITY
return '1.0'
elif o == INFINITY:
text = 'Infinity'
elif o == -INFINITY:
Expand Down

0 comments on commit 905f275

Please sign in to comment.