summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2019-07-14 18:03:58 -0500
committerSebastian Berg <sebastian@sipsolutions.net>2019-07-14 18:07:34 -0500
commit1171d5916ebbc34f6103aadb81505b5fbf9a034f (patch)
treecd06ad41b15c91fa2be08387ce6ce1f232e1cf44
parente02cdeecff23914792291f76bd5804902f0006c1 (diff)
downloadnumpy-1171d5916ebbc34f6103aadb81505b5fbf9a034f.tar.gz
ENH: Chain exception for typed item assignment
This was discussed in gh-14000, and slightly improves the situation at least maybe to the extend of understanding why it happens when looking more closely.
-rw-r--r--numpy/core/src/multiarray/arraytypes.c.src4
1 files changed, 1 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src
index c586a0b1d..5d9e990e8 100644
--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -221,9 +221,7 @@ static int
if (PySequence_NoString_Check(op)) {
PyErr_SetString(PyExc_ValueError,
"setting an array element with a sequence.");
- Py_DECREF(type);
- Py_XDECREF(value);
- Py_XDECREF(traceback);
+ npy_PyErr_ChainExceptionsCause(type, value, traceback);
}
else {
PyErr_Restore(type, value, traceback);