diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp index bdd2479629dc4d5bf939b3baa2b6fdfe02c7e657..843de9e4453f49aa6405d3d8d081d4f91fa72a80 100644 --- a/src/wrap_cl.hpp +++ b/src/wrap_cl.hpp @@ -2066,11 +2066,13 @@ namespace pyopencl #if PY_VERSION_HEX >= 0x03020000 if (PySlice_GetIndicesEx(slc.ptr(), + my_length, &start, &end, &stride, &length) != 0) + throw py::error_already_set(); #else if (PySlice_GetIndicesEx(reinterpret_cast(slc.ptr()), -#endif my_length, &start, &end, &stride, &length) != 0) throw py::error_already_set(); +#endif if (stride != 1) throw pyopencl::error("Buffer.__getitem__", CL_INVALID_VALUE,