cpython: d14f717b5e3d (original) (raw)
Mercurial > cpython
changeset 72344:d14f717b5e3d 3.2
Issue #12963: PyLong_AsSize_t() now returns (size_t)-1 in all error cases. [#12963]
Stefan Krah skrah@bytereef.org | |
---|---|
date | Mon, 12 Sep 2011 16:22:47 +0200 |
parents | 1ab62d3b96d2 |
children | c91900e4e805 882d3b78b1cc |
files | Objects/longobject.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-)[+] [-] Objects/longobject.c 6 |
line wrap: on
line diff
--- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -525,8 +525,8 @@ PyLong_AsUnsignedLong(PyObject vv) 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
size_t PyLong_AsSize_t(PyObject *vv) @@ -562,7 +562,7 @@ PyLong_AsSize_t(PyObject *vv) if ((x >> PyLong_SHIFT) != prev) { PyErr_SetString(PyExc_OverflowError, "Python int too large to convert to C size_t");
return (unsigned long) -1;[](#l1.18)