]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Eliminate outdated usages of PyInt_GetMax.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 4 Dec 2007 22:18:27 +0000 (22:18 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 4 Dec 2007 22:18:27 +0000 (22:18 +0000)
Doc/c-api/utilities.rst
Python/modsupport.c

index 0a92230467826849076994cb0a40a18e636a43cf..e3533f0908919d3a289c458c03ba3f837e3481ef 100644 (file)
@@ -901,12 +901,10 @@ return true, otherwise they return false and raise an appropriate exception.
       Convert a C :ctype:`unsigned short int` to a Python integer object.
 
    ``I`` (integer/long) [unsigned int]
-      Convert a C :ctype:`unsigned int` to a Python integer object or a Python long
-      integer object, if it is larger than ``sys.maxint``.
+      Convert a C :ctype:`unsigned int` to a Python long integer object.
 
    ``k`` (integer/long) [unsigned long]
-      Convert a C :ctype:`unsigned long` to a Python integer object or a Python long
-      integer object, if it is larger than ``sys.maxint``.
+      Convert a C :ctype:`unsigned long` to a Python long integer object.
 
    ``L`` (long) [PY_LONG_LONG]
       Convert a C :ctype:`long long` to a Python integer object. Only available
index aca57a4b000c26d0ba4d77bfb2ef687b2710e068..68e1fa4a6afd88e52e07ff471edeaf058027e2d8 100644 (file)
@@ -316,10 +316,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
                {
                        unsigned int n;
                        n = va_arg(*p_va, unsigned int);
-                       if (n > (unsigned long)PyInt_GetMax())
-                               return PyLong_FromUnsignedLong((unsigned long)n);
-                       else
-                               return PyLong_FromLong(n);
+                       return PyLong_FromUnsignedLong(n);
                }
                
                case 'n':
@@ -334,10 +331,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
                {
                        unsigned long n;
                        n = va_arg(*p_va, unsigned long);
-                       if (n > (unsigned long)PyInt_GetMax())
-                               return PyLong_FromUnsignedLong(n);
-                       else
-                               return PyLong_FromLong(n);
+                       return PyLong_FromUnsignedLong(n);
                }
 
 #ifdef HAVE_LONG_LONG