Commit 1f5a610b authored by Stefan Behnel's avatar Stefan Behnel

Change an exception return value to avoid an "umbiguous exception value" warning by Cython itself.

parent f9dbd6a2
...@@ -7250,8 +7250,8 @@ class AttributeNode(ExprNode): ...@@ -7250,8 +7250,8 @@ class AttributeNode(ExprNode):
code.put_incref_memoryviewslice(self.result(), self.type, code.put_incref_memoryviewslice(self.result(), self.type,
have_gil=True) have_gil=True)
T = "__pyx_memslice_transpose(&%s) == 0" T = "__pyx_memslice_transpose(&%s)" % self.result()
code.putln(code.error_goto_if(T % self.result(), self.pos)) code.putln(code.error_goto_if_neg(T, self.pos))
elif self.initialized_check: elif self.initialized_check:
code.putln( code.putln(
'if (unlikely(!%s.memview)) {' 'if (unlikely(!%s.memview)) {'
......
...@@ -940,7 +940,7 @@ cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, ...@@ -940,7 +940,7 @@ cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
### Transposing a memoryviewslice ### Transposing a memoryviewslice
# #
@cname('__pyx_memslice_transpose') @cname('__pyx_memslice_transpose')
cdef int transpose_memslice({{memviewslice_name}} *memslice) nogil except 0: cdef int transpose_memslice({{memviewslice_name}} *memslice) nogil except -1:
cdef int ndim = memslice.memview.view.ndim cdef int ndim = memslice.memview.view.ndim
cdef Py_ssize_t *shape = memslice.shape cdef Py_ssize_t *shape = memslice.shape
...@@ -956,7 +956,7 @@ cdef int transpose_memslice({{memviewslice_name}} *memslice) nogil except 0: ...@@ -956,7 +956,7 @@ cdef int transpose_memslice({{memviewslice_name}} *memslice) nogil except 0:
if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
_err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
return 1 return 0
# #
### Creating new memoryview objects from slices and memoryviews ### Creating new memoryview objects from slices and memoryviews
......
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