diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2011-04-05 15:01:52 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-04-05 17:38:00 -0600 |
commit | cfd766456368777bcb0d5edabd360b3aeb02d3f8 (patch) | |
tree | b38cd1bf7520faba8e2c0268e85253df7fe1f23f /numpy/matrixlib/defmatrix.py | |
parent | a4100ba6c440bdf2a2b3cfc31995eb5e009846ee (diff) | |
download | numpy-cfd766456368777bcb0d5edabd360b3aeb02d3f8.tar.gz |
STY: Update exception style, easy ones.
Diffstat (limited to 'numpy/matrixlib/defmatrix.py')
-rw-r--r-- | numpy/matrixlib/defmatrix.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/matrixlib/defmatrix.py b/numpy/matrixlib/defmatrix.py index a5aa84f6d..a46f2dab0 100644 --- a/numpy/matrixlib/defmatrix.py +++ b/numpy/matrixlib/defmatrix.py @@ -47,7 +47,7 @@ def _convert_from_string(data): if count == 0: Ncols = len(newrow) elif len(newrow) != Ncols: - raise ValueError, "Rows not the same size." + raise ValueError("Rows not the same size.") count += 1 newdata.append(newrow) return newdata @@ -258,7 +258,7 @@ class matrix(N.ndarray): ndim = arr.ndim shape = arr.shape if (ndim > 2): - raise ValueError, "matrix must be 2-dimensional" + raise ValueError("matrix must be 2-dimensional") elif ndim == 0: shape = (1,1) elif ndim == 1: @@ -289,7 +289,7 @@ class matrix(N.ndarray): self.shape = newshape return elif (ndim > 2): - raise ValueError, "shape too large to be a matrix." + raise ValueError("shape too large to be a matrix.") else: newshape = self.shape if ndim == 0: @@ -373,7 +373,7 @@ class matrix(N.ndarray): elif axis==1: return self.transpose() else: - raise ValueError, "unsupported axis" + raise ValueError("unsupported axis") # Necessary because base-class tolist expects dimension # reduction by x[0] |