diff options
author | Eric Smith <eric@trueblade.com> | 2009-10-27 18:33:14 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2009-10-27 18:33:14 (GMT) |
commit | abc9f7038154c5bd5d3a6042ab972f2db0fbc241 (patch) | |
tree | 37855d5b21c89d6084c60c16ec255aff7c79fcc2 /Python/ast.c | |
parent | dd62966a5fbc502a0e8d91ca3a7de843f1800d99 (diff) | |
download | cpython-abc9f7038154c5bd5d3a6042ab972f2db0fbc241.zip cpython-abc9f7038154c5bd5d3a6042ab972f2db0fbc241.tar.gz cpython-abc9f7038154c5bd5d3a6042ab972f2db0fbc241.tar.bz2 |
Removed PyOS_ascii_atof from ast.c, as mentioned in issue 7117.
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/ast.c b/Python/ast.c index 3422c2e..347da2a 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3236,17 +3236,17 @@ parsenumber(struct compiling *c, const char *s) #ifndef WITHOUT_COMPLEX if (imflag) { complex.real = 0.; - PyFPE_START_PROTECT("atof", return 0) - complex.imag = PyOS_ascii_atof(s); - PyFPE_END_PROTECT(complex) + complex.imag = PyOS_string_to_double(s, (char **)&end, NULL); + if (complex.imag == -1.0 && PyErr_Occurred()) + return NULL; return PyComplex_FromCComplex(complex); } else #endif { - PyFPE_START_PROTECT("atof", return 0) - dx = PyOS_ascii_atof(s); - PyFPE_END_PROTECT(dx) + dx = PyOS_string_to_double(s, NULL, NULL); + if (dx == -1.0 && PyErr_Occurred()) + return NULL; return PyFloat_FromDouble(dx); } } |