summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2011-04-05 15:01:52 -0600
committerCharles Harris <charlesr.harris@gmail.com>2011-04-05 17:38:00 -0600
commitcfd766456368777bcb0d5edabd360b3aeb02d3f8 (patch)
treeb38cd1bf7520faba8e2c0268e85253df7fe1f23f /numpy/ma/core.py
parenta4100ba6c440bdf2a2b3cfc31995eb5e009846ee (diff)
downloadnumpy-cfd766456368777bcb0d5edabd360b3aeb02d3f8.tar.gz
STY: Update exception style, easy ones.
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r--numpy/ma/core.py8
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)