* 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. */
| 867 | * silenced error. |
| 868 | */ |
| 869 | NPY_NO_EXPORT int |
| 870 | DEPRECATE_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 | |
| 884 | NPY_NO_EXPORT PyObject * |
no test coverage detected