summaryrefslogtreecommitdiff
path: root/Objects/sliceobject.c
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-11-06 15:17:32 +0000
committerMichael W. Hudson <mwh@python.net>2002-11-06 15:17:32 +0000
commitcbd6fb90069ded106833efc42b1c93bcf9b958c3 (patch)
tree8eeab999a6326865b004c50ebbf3dca1ebe1f334 /Objects/sliceobject.c
parent9050a517c8393a473b42333281e36ec35370af35 (diff)
downloadcpython-git-cbd6fb90069ded106833efc42b1c93bcf9b958c3.tar.gz
Handle really big steps in extended slices.
Fixes a test failure on 64 bit platforms (I hope).
Diffstat (limited to 'Objects/sliceobject.c')
-rw-r--r--Objects/sliceobject.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index a035e5faf0..7198cca4b1 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -121,11 +121,8 @@ PySlice_GetIndicesEx(PySliceObject *r, int length,
*step = 1;
}
else {
- *step = PyInt_AsLong(r->step);
- if (*step == -1 && PyErr_Occurred()) {
- return -1;
- }
- else if (*step == 0) {
+ if (!_PyEval_SliceIndex(r->step, step)) return -1;
+ if (*step == 0) {
PyErr_SetString(PyExc_ValueError,
"slice step cannot be zero");
return -1;