From 1171d5916ebbc34f6103aadb81505b5fbf9a034f Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Sun, 14 Jul 2019 18:03:58 -0500 Subject: 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. --- numpy/core/src/multiarray/arraytypes.c.src | 4 +--- 1 file changed, 1 insertion(+), 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); -- cgit v1.2.1