diff options
Diffstat (limited to 'numpy/polynomial/polyutils.py')
-rw-r--r-- | numpy/polynomial/polyutils.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/polynomial/polyutils.py b/numpy/polynomial/polyutils.py index ec7ba6f1d..b1cf07e8a 100644 --- a/numpy/polynomial/polyutils.py +++ b/numpy/polynomial/polyutils.py @@ -193,8 +193,8 @@ def as_series(alist, trim=True): else: try: dtype = np.common_type(*arrays) - except Exception: - raise ValueError("Coefficient arrays have no common type") + except Exception as e: + raise ValueError("Coefficient arrays have no common type") from e ret = [np.array(a, copy=True, dtype=dtype) for a in arrays] return ret @@ -777,7 +777,7 @@ def _deprecate_as_int(x, desc): """ try: return operator.index(x) - except TypeError: + except TypeError as e: # Numpy 1.17.0, 2019-03-11 try: ix = int(x) @@ -793,4 +793,4 @@ def _deprecate_as_int(x, desc): ) return ix - raise TypeError(f"{desc} must be an integer") + raise TypeError(f"{desc} must be an integer") from e |