[Python-checkins] cpython (merge 3.2 -> default): Merge fix for issue #12963.

stefan.krah python-checkins at python.org
Mon Sep 12 16:27:42 CEST 2011


http://hg.python.org/cpython/rev/c91900e4e805
changeset:   72345:c91900e4e805
parent:      72343:800a43a3869c
parent:      72344:d14f717b5e3d
user:        Stefan Krah <skrah at bytereef.org>
date:        Mon Sep 12 16:24:48 2011 +0200
summary:
  Merge fix for issue #12963.

files:
  Objects/longobject.c |  6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Objects/longobject.c b/Objects/longobject.c
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -525,8 +525,8 @@
     return x;
 }
 
-/* Get a C unsigned long int from a long int object.
-   Returns -1 and sets an error condition if overflow occurs. */
+/* Get a C size_t from a long int object. Returns (size_t)-1 and sets
+   an error condition if overflow occurs. */
 
 size_t
 PyLong_AsSize_t(PyObject *vv)
@@ -562,7 +562,7 @@
         if ((x >> PyLong_SHIFT) != prev) {
             PyErr_SetString(PyExc_OverflowError,
                 "Python int too large to convert to C size_t");
-            return (unsigned long) -1;
+            return (size_t) -1;
         }
     }
     return x;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list