[pypy-commit] pypy fastjson: one more corner case

antocuni noreply at buildbot.pypy.org
Sat Jun 29 10:35:56 CEST 2013


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: fastjson
Changeset: r65087:7c8873f9eeb2
Date: 2013-06-28 18:58 +0200
http://bitbucket.org/pypy/pypy/changeset/7c8873f9eeb2/

Log:	one more corner case

diff --git a/pypy/module/_fastjson/interp_decoder.py b/pypy/module/_fastjson/interp_decoder.py
--- a/pypy/module/_fastjson/interp_decoder.py
+++ b/pypy/module/_fastjson/interp_decoder.py
@@ -186,6 +186,8 @@
         if self.ll_chars[i] == 'e' or self.ll_chars[i] == 'E':
             is_float = True
             i += 1
+            if self.ll_chars[i] == '+' or self.ll_chars[i] == '-':
+                i += 1
             while self.ll_chars[i].isdigit():
                 i += 1
         #
diff --git a/pypy/module/_fastjson/test/test__fastjson.py b/pypy/module/_fastjson/test/test__fastjson.py
--- a/pypy/module/_fastjson/test/test__fastjson.py
+++ b/pypy/module/_fastjson/test/test__fastjson.py
@@ -126,6 +126,8 @@
         check(x, float(x))
         x = str(sys.maxint+1) + 'E1'
         check(x, float(x))
+        x = str(sys.maxint+1) + 'E-1'
+        check(x, float(x))
         #
         check('1E400', float('inf'))
 


More information about the pypy-commit mailing list