summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-02-04 19:05:08 +0100
committerBas van Beek <b.f.van.beek@vu.nl>2021-02-09 15:25:49 +0100
commit692f00b7156bd03223cea0381e5928dad34323fd (patch)
tree7d7e178a5e91c3a09db52bd07b1911f64368bf99
parent58e3b94460bb0dab610e968431d2f7e51a4d6863 (diff)
downloadnumpy-692f00b7156bd03223cea0381e5928dad34323fd.tar.gz
MAINT: Fix the dtype mentioned in 2 `np.lib.ufunclike` exceptions
-rw-r--r--numpy/lib/ufunclike.py6
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)