summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-27 19:45:25 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-27 19:45:25 (GMT)
commit71b6af91d382a0e084b55f1d519aedc1b71a97d4 (patch)
treea2cc5cc6e240174dd8197dbb302a9a86574e4fa3 /Python
parent9aa70d93aae89a9404a58f32f3fcd3c72b1ee56b (diff)
downloadcpython-71b6af91d382a0e084b55f1d519aedc1b71a97d4.zip
cpython-71b6af91d382a0e084b55f1d519aedc1b71a97d4.tar.gz
cpython-71b6af91d382a0e084b55f1d519aedc1b71a97d4.tar.bz2
If an integer constant can't be generated from an integer literal
because of overflow, generate a long instead.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Python/compile.c b/Python/compile.c
index c6c3394..d238a30 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1084,11 +1084,8 @@ parsenumber(struct compiling *co, char *s)
else
x = PyOS_strtol(s, &end, 0);
if (*end == '\0') {
- if (errno != 0) {
- com_error(co, PyExc_OverflowError,
- "integer literal too large");
- return NULL;
- }
+ if (errno != 0)
+ return PyLong_FromString(s, (char **)0, 0);
return PyInt_FromLong(x);
}
/* XXX Huge floats may silently fail */