8000 Merge pull request #20986 from charris/backport-20980 · numpy/numpy@da47aa2 · GitHub
[go: up one dir, main page]

Skip to content

Commit da47aa2

Browse files
authored
Merge pull request #20986 from charris/backport-20980
BUG: Fix misplaced return.
2 parents 0045308 + fdca17c commit da47aa2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

numpy/core/src/multiarray/dtype_transfer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,9 +3021,9 @@ init_cast_info(NPY_cast_info *cast_info, NPY_CASTING *casting,
30213021
if (!PyErr_Occurred()) {
30223022
PyErr_Format(PyExc_TypeError,
30233023
"Cannot cast array data from %R to %R.", src_dtype, dst_dtype);
3024-
Py_DECREF(meth);
3025-
return -1;
30263024
}
3025+
Py_DECREF(meth);
3026+
return -1;
30273027
}
30283028
assert(PyArray_DescrCheck(cast_info->descriptors[0]));
30293029
assert(PyArray_DescrCheck(cast_info->descriptors[1]));

0 commit comments

Comments
 (0)
0