summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2011-09-12 14:24:48 (GMT)
committerStefan Krah <skrah@bytereef.org>2011-09-12 14:24:48 (GMT)
commit2d78a87e2ecb30bd22b13bd77cc58c09ac989293 (patch)
tree89b405afb34bdf2df00b472e3e85a3c7379d57da /Objects
parent1c82a14e86aa2bfec4311d9a47ad81aabdbb15dd (diff)
parentb77c6c65c06a19740fe2f22004959a4aa1eaba5d (diff)
downloadcpython-2d78a87e2ecb30bd22b13bd77cc58c09ac989293.zip
cpython-2d78a87e2ecb30bd22b13bd77cc58c09ac989293.tar.gz
cpython-2d78a87e2ecb30bd22b13bd77cc58c09ac989293.tar.bz2
Merge fix for issue #12963.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/longobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 8f6f18f..5a4259d 100644
--- 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
+ an error condition if overflow occurs. */
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;
+ return (size_t) -1;
}
}
return x;