summaryrefslogtreecommitdiff
path: root/numpy/polynomial/polyutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/polynomial/polyutils.py')
-rw-r--r--numpy/polynomial/polyutils.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/numpy/polynomial/polyutils.py b/numpy/polynomial/polyutils.py
index b65e88a83..9b8e9fc42 100644
--- a/numpy/polynomial/polyutils.py
+++ b/numpy/polynomial/polyutils.py
@@ -540,17 +540,15 @@ def _valnd(val_f, c, *args):
c, args :
See the ``<type>val<n>d`` functions for more detail
"""
- try:
- args = tuple(np.array(args, copy=False))
- except Exception:
- # preserve the old error message
- if len(args) == 2:
+ args = [np.asanyarray(a) for a in args]
+ shape0 = args[0].shape
+ if not all((a.shape == shape0 for a in args[1:])):
+ if len(args) == 3:
raise ValueError('x, y, z are incompatible')
- elif len(args) == 3:
+ elif len(args) == 2:
raise ValueError('x, y are incompatible')
else:
raise ValueError('ordinates are incompatible')
-
it = iter(args)
x0 = next(it)