From: Georg Brandl Date: Thu, 8 Jun 2006 13:31:14 +0000 (+0000) Subject: Argh. "integer" is a very confusing word ;) X-Git-Tag: v2.4.4c1~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8532999ccf919917301a256bea8c068104ee539c;p=thirdparty%2FPython%2Fcpython.git 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) --- diff --git a/Python/getargs.c b/Python/getargs.c index be79b7516e32..2d231ce14c34 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -552,12 +552,12 @@ convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf, ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) return converterr("integer", 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", 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", arg, msgbuf, bufsize);