summaryrefslogtreecommitdiff
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-08 09:53:51 +0300
committerGitHub <noreply@github.com>2017-04-08 09:53:51 +0300
commitb879fe82e7e5c3f7673c9a7fa4aad42bd05445d8 (patch)
tree714c168e58166c2acb07b737ce3ca02db71fe2af /Modules/_elementtree.c
parent205e00c5cfd495a4dc6dae8e8fa0fb828fb3dca9 (diff)
downloadcpython-git-b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8.tar.gz
Expand the PySlice_GetIndicesEx macro. (#1023)
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r--Modules/_elementtree.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 4e1750f9dd..456c4a2a79 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -1740,11 +1740,11 @@ element_subscr(PyObject* self_, PyObject* item)
if (!self->extra)
return PyList_New(0);
- if (PySlice_GetIndicesEx(item,
- self->extra->length,
- &start, &stop, &step, &slicelen) < 0) {
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
return NULL;
}
+ slicelen = PySlice_AdjustIndices(self->extra->length, &start, &stop,
+ step);
if (slicelen <= 0)
return PyList_New(0);
@@ -1796,11 +1796,11 @@ element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value)
return -1;
}
- if (PySlice_GetIndicesEx(item,
- self->extra->length,
- &start, &stop, &step, &slicelen) < 0) {
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
return -1;
}
+ slicelen = PySlice_AdjustIndices(self->extra->length, &start, &stop,
+ step);
if (value == NULL) {
/* Delete slice */