From cc29bd11e9f3da5777efdeb49a464be08e5b8806 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Sun, 16 Mar 2008 18:42:56 +0000 Subject: use str(float) instead of repr(float) git-svn-id: http://simplejson.googlecode.com/svn/trunk@61 a4795897-2c25-0410-b006-0d3caba88fa1 --- simplejson/encoder.py | 2 +- simplejson/tests/test_float.py | 2 +- 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) -- cgit v1.2.1