diff options
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/src/umath/ufunc_type_resolution.c | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_datetime.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c index e77b48fc4..1766ba564 100644 --- a/numpy/core/src/umath/ufunc_type_resolution.c +++ b/numpy/core/src/umath/ufunc_type_resolution.c @@ -544,7 +544,7 @@ PyUFunc_IsNaTTypeResolver(PyUFuncObject *ufunc, PyArray_Descr **out_dtypes) { if (!PyTypeNum_ISDATETIME(PyArray_DESCR(operands[0])->type_num)) { - PyErr_SetString(PyExc_ValueError, + PyErr_SetString(PyExc_TypeError, "ufunc 'isnat' is only defined for datetime and timedelta."); return -1; } diff --git a/numpy/core/tests/test_datetime.py b/numpy/core/tests/test_datetime.py index 10fa9b060..dc84a039c 100644 --- a/numpy/core/tests/test_datetime.py +++ b/numpy/core/tests/test_datetime.py @@ -1963,7 +1963,7 @@ class TestDateTime(object): for t in np.typecodes["All"]: if t in np.typecodes["Datetime"]: continue - assert_raises(ValueError, np.isnat, np.zeros(10, t)) + assert_raises(TypeError, np.isnat, np.zeros(10, t)) class TestDateTimeData(object): |