diff options
Diffstat (limited to 'numpy/core/src/umath/loops.c.src')
-rw-r--r-- | numpy/core/src/umath/loops.c.src | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src index 12c0d85ec..670c39ea2 100644 --- a/numpy/core/src/umath/loops.c.src +++ b/numpy/core/src/umath/loops.c.src @@ -1287,6 +1287,7 @@ NPY_NO_EXPORT void NPY_NO_EXPORT void @TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func)) { + npy_bool give_future_warning = 0; BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; const @type@ in2 = *(@type@ *)ip2; @@ -1294,17 +1295,19 @@ NPY_NO_EXPORT void *((npy_bool *)op1) = res; if ((in1 == NPY_DATETIME_NAT || in2 == NPY_DATETIME_NAT) && res) { - NPY_ALLOW_C_API_DEF - NPY_ALLOW_C_API; - /* 2016-01-18, 1.11 */ - if (DEPRECATE_FUTUREWARNING( - "In the future, 'NAT @OP@ x' and 'x @OP@ NAT' " - "will always be False.") < 0) { - NPY_DISABLE_C_API; - return; - } - NPY_DISABLE_C_API; + give_future_warning = 1; + } + } + if (give_future_warning) { + NPY_ALLOW_C_API_DEF + NPY_ALLOW_C_API; + /* 2016-01-18, 1.11 */ + if (DEPRECATE_FUTUREWARNING( + "In the future, 'NAT @OP@ x' and 'x @OP@ NAT' " + "will always be False.") < 0) { + /* nothing to do, we return anyway */ } + NPY_DISABLE_C_API; } } /**end repeat1**/ @@ -1312,23 +1315,26 @@ NPY_NO_EXPORT void NPY_NO_EXPORT void @TYPE@_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func)) { + npy_bool give_future_warning = 0; BINARY_LOOP { const @type@ in1 = *(@type@ *)ip1; const @type@ in2 = *(@type@ *)ip2; *((npy_bool *)op1) = in1 != in2; if (in1 == NPY_DATETIME_NAT && in2 == NPY_DATETIME_NAT) { - NPY_ALLOW_C_API_DEF - NPY_ALLOW_C_API; - /* 2016-01-18, 1.11 */ - if (DEPRECATE_FUTUREWARNING( - "In the future, NAT != NAT will be True " - "rather than False.") < 0) { - NPY_DISABLE_C_API; - return; - } - NPY_DISABLE_C_API; + give_future_warning = 1; + } + } + if (give_future_warning) { + NPY_ALLOW_C_API_DEF + NPY_ALLOW_C_API; + /* 2016-01-18, 1.11 */ + if (DEPRECATE_FUTUREWARNING( + "In the future, NAT != NAT will be True " + "rather than False.") < 0) { + /* nothing to do, we return anyway */ } + NPY_DISABLE_C_API; } } |