]> granicus.if.org Git - python/commitdiff
Argh. "integer" is a very confusing word ;)
authorGeorg Brandl <georg@python.org>
Thu, 8 Jun 2006 13:31:07 +0000 (13:31 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 8 Jun 2006 13:31:07 +0000 (13:31 +0000)
Actually, checking for INT_MAX and INT_MIN is correct since
the format code explicitly handles a C "int".

Misc/NEWS
Python/getargs.c

index 19664a2344a81530c26103a2730735060a4373b8..d54806a9afd1e5ab0399a4275293ef6728ed12f4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -213,9 +213,6 @@ What's New in Python 2.5 alpha 2?
 Core and builtins
 -----------------
 
-- Bug #1502750: Check bounds integer arguments correctly on 64-bit
-  platforms.
-
 - Bug #1465834: 'bdist_wininst preinstall script support' was fixed
   by converting these apis from macros into exported functions again:
 
index 727376d640aa1dde5e0883a6ded915e092a6b394..1552790ef0805281b58051175a73f8abfeca9bb7 100644 (file)
@@ -624,12 +624,12 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
                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);