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

switch back to repr for accuracy

git-svn-id: http://simplejson.googlecode.com/svn/trunk@64 a4795897-2c25-0410-b006-0d3caba88fa1
parent 8d751eba8ce5
Branches
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@
# assume this produces an infinity on all machines (probably not guaranteed)
INFINITY = float('1e66666')
FLOAT_REPR = repr
def floatstr(o, allow_nan=True):
# Check for specials. Note that this type of test is processor- and/or
......@@ -37,7 +38,7 @@
elif o == -INFINITY:
text = '-Infinity'
else:
return str(o)
return FLOAT_REPR(o)
if not allow_nan:
raise ValueError("Out of range float values are not JSON compliant: %r"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment