Commit 9d33c746 authored by Stefan Behnel's avatar Stefan Behnel

simplify shape unpacking code in cython.array initialiser

--HG--
extra : amend_source : 4d5d9dc96421710652afe8614c9f32db26cc88c1
parent 8065ec46
......@@ -117,7 +117,7 @@ cdef class array:
mode="c", bint allocate_buffer=True):
cdef int idx
cdef Py_ssize_t i
cdef Py_ssize_t i, dim
cdef PyObject **p
self.ndim = <int> len(shape)
......@@ -142,13 +142,10 @@ cdef class array:
raise MemoryError("unable to allocate shape and strides.")
# cdef Py_ssize_t dim, stride
idx = 0
for idx, dim in enumerate(shape):
if dim <= 0:
raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
self._shape[idx] = dim
idx += 1
cdef char order
if mode == 'fortran':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment