If an integer constant can't be generated from an integer literal
because of overflow, generate a long instead.
This commit is contained in:
parent
9aa70d93aa
commit
71b6af91d3
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue