diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2019-07-14 18:03:58 -0500 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2019-07-14 18:07:34 -0500 |
commit | 1171d5916ebbc34f6103aadb81505b5fbf9a034f (patch) | |
tree | cd06ad41b15c91fa2be08387ce6ce1f232e1cf44 | |
parent | e02cdeecff23914792291f76bd5804902f0006c1 (diff) | |
download | numpy-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.src | 4 |
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); |