From bbf8011d09f2962444e70142791eee1b369616fc Mon Sep 17 00:00:00 2001 From: Ziyan Date: Wed, 8 Nov 2017 10:39:47 +0900 Subject: [PATCH] ENH skip NPY_ALLOW_C_API for UFUNC_ERR_IGNORE GIL unnecessary when numpy floating point error handling is set to ignore. --- numpy/core/src/umath/extobj.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/numpy/core/src/umath/extobj.c b/numpy/core/src/umath/extobj.c index 34498162265f..e44036358ebb 100644 --- a/numpy/core/src/umath/extobj.c +++ b/numpy/core/src/umath/extobj.c @@ -76,6 +76,11 @@ _error_handler(int method, PyObject *errobj, char *errtype, int retstatus, int * NPY_ALLOW_C_API_DEF + /* don't need C API for a simple ignore */ + if (method == UFUNC_ERR_IGNORE) { + return 0; + } + /* don't need C API for a simple print */ if (method == UFUNC_ERR_PRINT) { if (*first) {