From 71b6af91d382a0e084b55f1d519aedc1b71a97d4 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Mon, 27 Aug 2001 19:45:25 +0000 Subject: [PATCH] If an integer constant can't be generated from an integer literal because of overflow, generate a long instead. --- Python/compile.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Python/compile.c b/Python/compile.c index c6c33942d20..d238a302a5e 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 */