diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2010-12-03 20:14:31 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2010-12-03 20:14:31 (GMT) |
commit | 4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9 (patch) | |
tree | c8f1fef715f8d158e58f17cab14af65455de1d77 /Objects/rangeobject.c | |
parent | c4df7845143f9afe0d20f4421a41904f3cbb991a (diff) | |
download | cpython-4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9.zip cpython-4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9.tar.gz cpython-4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9.tar.bz2 |
Merge branches/pep-0384.
Diffstat (limited to 'Objects/rangeobject.c')
-rw-r--r-- | Objects/rangeobject.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index bf42b1e..3ac829a 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -431,7 +431,6 @@ range_subscript(rangeobject* self, PyObject* item) return range_item(self, i); } if (PySlice_Check(item)) { - PySliceObject *slice = (PySliceObject*)item; Py_ssize_t start, stop, step, len, rlen; rangeobject *result; PyObject *substart = NULL, *substep = NULL, *substop = NULL; @@ -441,7 +440,7 @@ range_subscript(rangeobject* self, PyObject* item) return NULL; } - if (PySlice_GetIndicesEx(slice, rlen, + if (PySlice_GetIndicesEx(item, rlen, &start, &stop, &step, &len) < 0) { return NULL; } @@ -450,7 +449,7 @@ range_subscript(rangeobject* self, PyObject* item) Py_INCREF(substep); } else { /* NB: slice step != Py_None here */ - substep = PyNumber_Multiply(self->step, slice->step); + substep = PyNumber_Multiply(self->step, ((PySliceObject*)item)->step); if (substep == NULL) goto fail; } |