diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-04-08 09:53:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-08 09:53:51 +0300 |
commit | b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8 (patch) | |
tree | 714c168e58166c2acb07b737ce3ca02db71fe2af /Objects/bytesobject.c | |
parent | 205e00c5cfd495a4dc6dae8e8fa0fb828fb3dca9 (diff) | |
download | cpython-git-b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8.tar.gz |
Expand the PySlice_GetIndicesEx macro. (#1023)
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r-- | Objects/bytesobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index bde7948c10..e95ab9c63b 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -1683,11 +1683,11 @@ bytes_subscript(PyBytesObject* self, PyObject* item) char* result_buf; PyObject* result; - if (PySlice_GetIndicesEx(item, - PyBytes_GET_SIZE(self), - &start, &stop, &step, &slicelength) < 0) { + if (PySlice_Unpack(item, &start, &stop, &step) < 0) { return NULL; } + slicelength = PySlice_AdjustIndices(PyBytes_GET_SIZE(self), &start, + &stop, step); if (slicelength <= 0) { return PyBytes_FromStringAndSize("", 0); |