From 8532999ccf919917301a256bea8c068104ee539c Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 8 Jun 2006 13:31:14 +0000 Subject: [PATCH] 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) --- Python/getargs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.47.3