]> granicus.if.org Git - python/commitdiff
Issue 7117: Replace PyOS_ascii_strtod with PyOS_string_to_double in _json.c as part...
authorEric Smith <eric@trueblade.com>
Wed, 28 Oct 2009 08:44:37 +0000 (08:44 +0000)
committerEric Smith <eric@trueblade.com>
Wed, 28 Oct 2009 08:44:37 +0000 (08:44 +0000)
Modules/_json.c

index cfe87087d7f3c6bd78b98213516fb4430ae9556c..7c8abea8f0f278e09c28667e1a459f5581a85037 100644 (file)
@@ -1405,7 +1405,11 @@ _match_number_str(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ssiz
             rval = PyObject_CallFunctionObjArgs(s->parse_float, numstr, NULL);
         }
         else {
-            rval = PyFloat_FromDouble(PyOS_ascii_atof(PyString_AS_STRING(numstr)));
+            double d = PyOS_string_to_double(PyString_AS_STRING(numstr),
+                                             NULL, NULL);
+            if (d == -1.0 && PyErr_Occurred())
+                return NULL;
+            rval = PyFloat_FromDouble(d);
         }
     }
     else {