Skip to content

Commit 98251f8

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".
1 parent c9ae4e8 commit 98251f8

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

Misc/NEWS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ What's New in Python 2.5 alpha 2?
213213
Core and builtins
214214
-----------------
215215

216-
- Bug #1502750: Check bounds integer arguments correctly on 64-bit
217-
platforms.
218-
219216
- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
220217
by converting these apis from macros into exported functions again:
221218

Python/getargs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,12 +624,12 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
624624
ival = PyInt_AsLong(arg);
625625
if (ival == -1 && PyErr_Occurred())
626626
return converterr("integer<i>", arg, msgbuf, bufsize);
627-
else if (ival > LONG_MAX) {
627+
else if (ival > INT_MAX) {
628628
PyErr_SetString(PyExc_OverflowError,
629629
"signed integer is greater than maximum");
630630
return converterr("integer<i>", arg, msgbuf, bufsize);
631631
}
632-
else if (ival < LONG_MIN) {
632+
else if (ival < INT_MIN) {
633633
PyErr_SetString(PyExc_OverflowError,
634634
"signed integer is less than minimum");
635635
return converterr("integer<i>", arg, msgbuf, bufsize);

0 commit comments

Comments
 (0)