Expand the PySlice_GetIndicesEx macro. (#1023) (#1044)

(cherry picked from commit b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8)
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index b1798a2..e1ac728 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -2285,10 +2285,10 @@
 {
     Py_ssize_t start, stop, step, slicelength;
 
-    if (PySlice_GetIndicesEx(key, base->shape[dim],
-                             &start, &stop, &step, &slicelength) < 0) {
+    if (PySlice_Unpack(key, &start, &stop, &step) < 0) {
         return -1;
     }
+    slicelength = PySlice_AdjustIndices(base->shape[dim], &start, &stop, step);
 
 
     if (base->suboffsets == NULL || dim == 0) {