Mercurial > cpython-lru_cache-weakref
diff Python/getargs.c @ 38667:e0d29586212a 2.4
Argh. "integer" is a very confusing word ;)
Actually, checking for INT_MAX and INT_MIN is correct since
the format code explicitly handles a C "int".
(backport from rev. 46746)
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Thu, 08 Jun 2006 13:31:14 +0000 |
| parents | 1d239c7e8d60 |
| children | 8022927c17a8 |
line wrap: on
line diff
--- a/Python/getargs.c Thu Jun 08 12:54:16 2006 +0000 +++ b/Python/getargs.c Thu Jun 08 13:31:14 2006 +0000 @@ -552,12 +552,12 @@ ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) return converterr("integer<i>", arg, msgbuf, bufsize); - else if (ival > LONG_MAX) { + else if (ival > INT_MAX) { PyErr_SetString(PyExc_OverflowError, "signed integer is greater than maximum"); return converterr("integer<i>", arg, msgbuf, bufsize); } - else if (ival < LONG_MIN) { + else if (ival < INT_MIN) { PyErr_SetString(PyExc_OverflowError, "signed integer is less than minimum"); return converterr("integer<i>", arg, msgbuf, bufsize);
