diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2008-07-16 11:04:17 +0000 |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2008-07-16 11:04:17 +0000 |
commit | 67e7f8a698d4cbbcbc66e4be63fc126cc1f5e84b (patch) | |
tree | c32ab97e0be32a24de92b6fb323e1bb135ee3eb9 /Python | |
parent | ffaa2acf5a734cb39a2650f2bc367ccb155e8f0b (diff) | |
download | cpython-67e7f8a698d4cbbcbc66e4be63fc126cc1f5e84b.tar.gz |
Issue #3360: Fix incorrect parsing of '020000000000.0'.
This is a backport of r65005.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/Python/ast.c b/Python/ast.c index 057b64df32..434236b307 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3067,16 +3067,7 @@ parsenumber(const char *s) #endif if (*end == 'l' || *end == 'L') return PyLong_FromString((char *)s, (char **)0, 0); - if (s[0] == '0') { - x = (long) PyOS_strtoul((char *)s, (char **)&end, 0); - if (x < 0 && errno == 0) { - return PyLong_FromString((char *)s, - (char **)0, - 0); - } - } - else - x = PyOS_strtol((char *)s, (char **)&end, 0); + x = PyOS_strtol((char *)s, (char **)&end, 0); if (*end == '\0') { if (errno != 0) return PyLong_FromString((char *)s, (char **)0, 0); |