Skip to content

Commit 8532999

Browse files
committed
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)
1 parent d404beb commit 8532999

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Python/getargs.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,12 +552,12 @@ convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf,
552552
ival = PyInt_AsLong(arg);
553553
if (ival == -1 && PyErr_Occurred())
554554
return converterr("integer<i>", arg, msgbuf, bufsize);
555-
else if (ival > LONG_MAX) {
555+
else if (ival > INT_MAX) {
556556
PyErr_SetString(PyExc_OverflowError,
557557
"signed integer is greater than maximum");
558558
return converterr("integer<i>", arg, msgbuf, bufsize);
559559
}
560-
else if (ival < LONG_MIN) {
560+
else if (ival < INT_MIN) {
561561
PyErr_SetString(PyExc_OverflowError,
562562
"signed integer is less than minimum");
563563
return converterr("integer<i>", arg, msgbuf, bufsize);

0 commit comments

Comments
 (0)