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

use str(float) instead of repr(float)

git-svn-id: http://simplejson.googlecode.com/svn/trunk@61 a4795897-2c25-0410-b006-0d3caba88fa1
parent 8332a8018542
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
elif o == -INFINITY: elif o == -INFINITY:
text = '-Infinity' text = '-Infinity'
else: else:
return repr(o) return str(o)
if not allow_nan: if not allow_nan:
raise ValueError("Out of range float values are not JSON compliant: %r" raise ValueError("Out of range float values are not JSON compliant: %r"
......
def test_floats(): def test_floats():
import simplejson import simplejson
for num in [1617161771.7650001]: for num in [1617161771.7650001]:
assert simplejson.dumps(num) == repr(num) assert simplejson.dumps(num) == str(num)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment