summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2008-03-16 18:42:56 +0000
committerBob Ippolito <bob@redivi.com>2008-03-16 18:42:56 +0000
commitcc29bd11e9f3da5777efdeb49a464be08e5b8806 (patch)
tree880837c665de06b1d95dec11a16f6b8979d97855
parent1e584b00ba4cf8c6737026cbb5b9ed278d228eee (diff)
downloadsimplejson-cc29bd11e9f3da5777efdeb49a464be08e5b8806.tar.gz
use str(float) instead of repr(float)
git-svn-id: http://simplejson.googlecode.com/svn/trunk@61 a4795897-2c25-0410-b006-0d3caba88fa1
-rw-r--r--simplejson/encoder.py2
-rw-r--r--simplejson/tests/test_float.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/simplejson/encoder.py b/simplejson/encoder.py
index d29919a..eec9c7f 100644
--- a/simplejson/encoder.py
+++ b/simplejson/encoder.py
@@ -37,7 +37,7 @@ def floatstr(o, allow_nan=True):
elif o == -INFINITY:
text = '-Infinity'
else:
- return repr(o)
+ return str(o)
if not allow_nan:
raise ValueError("Out of range float values are not JSON compliant: %r"
diff --git a/simplejson/tests/test_float.py b/simplejson/tests/test_float.py
index ee93358..9ac1632 100644
--- a/simplejson/tests/test_float.py
+++ b/simplejson/tests/test_float.py
@@ -1,4 +1,4 @@
def test_floats():
import simplejson
for num in [1617161771.7650001]:
- assert simplejson.dumps(num) == repr(num)
+ assert simplejson.dumps(num) == str(num)