From: Jeremy Hylton <jeremy@alum.mit.edu> Date: Mon, 27 Aug 2001 19:45:25 +0000 (+0000) Subject: If an integer constant can't be generated from an integer literal X-Git-Tag: v2.2a3~310 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71b6af91d382a0e084b55f1d519aedc1b71a97d4;p=python If an integer constant can't be generated from an integer literal because of overflow, generate a long instead. --- diff --git a/Python/compile.c b/Python/compile.c index c6c33942d2..d238a302a5 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 */