Skip to content

Commit 06d4b02

Browse files
committed
Restore the IndexError in pygpu_index.
1 parent a4c7381 commit 06d4b02

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pygpu/gpuarray.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,10 @@ cdef GpuArray pygpu_index(GpuArray a, const ssize_t *starts,
14121412
const ssize_t *stops, const ssize_t *steps):
14131413
cdef GpuArray res
14141414
res = new_GpuArray(type(a), a.context, a.base)
1415-
array_index(res, a, starts, stops, steps)
1415+
try:
1416+
array_index(res, a, starts, stops, steps)
1417+
except ValueError, e:
1418+
raise IndexError, "index out of bounds"
14161419
return res
14171420

14181421
cdef GpuArray pygpu_reshape(GpuArray a, unsigned int nd, const size_t *newdims,

0 commit comments

Comments
 (0)