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/ma/core.py | |
parent | a4100ba6c440bdf2a2b3cfc31995eb5e009846ee (diff) | |
download | numpy-cfd766456368777bcb0d5edabd360b3aeb02d3f8.tar.gz |
STY: Update exception style, easy ones.
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r-- | numpy/ma/core.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 936df17f3..1ea40d417 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -2976,7 +2976,7 @@ class MaskedArray(ndarray): """ if self is masked: - raise MaskError, 'Cannot alter the masked element.' + raise MaskError('Cannot alter the masked element.') # This test is useful, but we should keep things light... # if getmask(indx) is not nomask: # msg = "Masked arrays must be filled before they can be used as indices!" @@ -3792,7 +3792,7 @@ class MaskedArray(ndarray): raise TypeError("Only length-1 arrays can be converted "\ "to Python scalars") elif self._mask: - raise MaskError, 'Cannot convert masked element to a Python int.' + raise MaskError('Cannot convert masked element to a Python int.') return int(self.item()) @@ -5992,7 +5992,7 @@ def power(a, b, third=None): """ if third is not None: - raise MaskError, "3-argument power not supported." + raise MaskError("3-argument power not supported.") # Get the masks ma = getmask(a) mb = getmask(b) @@ -6536,7 +6536,7 @@ def where (condition, x=None, y=None): if x is None and y is None: return filled(condition, 0).nonzero() elif x is None or y is None: - raise ValueError, "Either both or neither x and y should be given." + raise ValueError("Either both or neither x and y should be given.") # Get the condition ............... fc = filled(condition, 0).astype(MaskType) notfc = np.logical_not(fc) |