Commit 71b6af91 authored by Jeremy Hylton's avatar Jeremy Hylton

If an integer constant can't be generated from an integer literal

because of overflow, generate a long instead.
parent 9aa70d93
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment