diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/lib/tests/test_ufunclike.py | 4 | ||||
-rw-r--r-- | numpy/lib/ufunclike.py | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py index 7c41ed1a3..889ee77e3 100644 --- a/numpy/lib/tests/test_ufunclike.py +++ b/numpy/lib/tests/test_ufunclike.py @@ -22,7 +22,7 @@ class TestUfunclike(object): assert_equal(out, tgt) a = a.astype(np.complex) - with assert_raises(ValueError): + with assert_raises(TypeError): ufl.isposinf(a) def test_isneginf(self): @@ -37,7 +37,7 @@ class TestUfunclike(object): assert_equal(out, tgt) a = a.astype(np.complex) - with assert_raises(ValueError): + with assert_raises(TypeError): ufl.isneginf(a) def test_fix(self): diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py index 6c6f0a056..4d21cb820 100644 --- a/numpy/lib/ufunclike.py +++ b/numpy/lib/ufunclike.py @@ -141,8 +141,8 @@ def isposinf(x, out=None): """ x = nx.asanyarray(x) if nx.issubdtype(x.dtype, nx.complexfloating): - raise ValueError('This operation is not supported for complex values' - 'because it would be ambiguous.') + raise TypeError('This operation is not supported for complex values ' + 'because it would be ambiguous.') return nx.logical_and(nx.isinf(x), ~nx.signbit(x), out) @@ -207,6 +207,6 @@ def isneginf(x, out=None): """ x = nx.asanyarray(x) if nx.issubdtype(x.dtype, nx.complexfloating): - raise ValueError('This operation is not supported for complex values' - 'because it would be ambiguous.') + raise TypeError('This operation is not supported for complex values ' + 'because it would be ambiguous.') return nx.logical_and(nx.isinf(x), nx.signbit(x), out) |