diff options
Diffstat (limited to 'numpy/lib/ufunclike.py')
-rw-r--r-- | numpy/lib/ufunclike.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py index 1f26a1845..0956de82b 100644 --- a/numpy/lib/ufunclike.py +++ b/numpy/lib/ufunclike.py @@ -189,7 +189,8 @@ def isposinf(x, out=None): try: signbit = ~nx.signbit(x) except TypeError as e: - raise TypeError('This operation is not supported for complex values ' + dtype = nx.asanyarray(x).dtype + raise TypeError(f'This operation is not supported for {dtype} values ' 'because it would be ambiguous.') from e else: return nx.logical_and(is_inf, signbit, out) @@ -260,7 +261,8 @@ def isneginf(x, out=None): try: signbit = nx.signbit(x) except TypeError as e: - raise TypeError('This operation is not supported for complex values ' + dtype = nx.asanyarray(x).dtype + raise TypeError(f'This operation is not supported for {dtype} values ' 'because it would be ambiguous.') from e else: return nx.logical_and(is_inf, signbit, out) |