summaryrefslogtreecommitdiff
path: root/Modules/_json.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_json.c')
-rw-r--r--Modules/_json.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_json.c b/Modules/_json.c
index cfe87087d7..7c8abea8f0 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -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 {