MCPcopy Create free account
hub / github.com/numpy/numpy / DEPRECATE_silence_error

Function DEPRECATE_silence_error

numpy/core/src/multiarray/arrayobject.c:869–881  ·  view source on GitHub ↗

* Silence the current error and emit a deprecation warning instead. * * If warnings are raised as errors, this sets the warning __cause__ to the * silenced error. */

Source from the content-addressed store, hash-verified

867 * silenced error.
868 */
869NPY_NO_EXPORT int
870DEPRECATE_silence_error(const char *msg) {
871 PyObject *exc, *val, *tb;
872 PyErr_Fetch(&exc, &val, &tb);
873 if (DEPRECATE(msg) < 0) {
874 npy_PyErr_ChainExceptionsCause(exc, val, tb);
875 return -1;
876 }
877 Py_XDECREF(exc);
878 Py_XDECREF(val);
879 Py_XDECREF(tb);
880 return 0;
881}
882
883
884NPY_NO_EXPORT PyObject *

Callers 1

array_richcompareFunction · 0.85

Calls 1

Tested by

no test coverage detected