summaryrefslogtreecommitdiff
path: root/numpy/ma
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma')
-rw-r--r--numpy/ma/core.py4
-rw-r--r--numpy/ma/extras.py2
-rw-r--r--numpy/ma/mrecords.py4
-rw-r--r--numpy/ma/tests/test_extras.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index d9401fa1d..b253b6f16 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -1068,7 +1068,7 @@ class _MaskedBinaryOperation:
# any errors, just abort; impossible to guarantee masked values
try:
np.copyto(result, da, casting='unsafe', where=m)
- except:
+ except Exception:
pass
# Transforms to a (subclass of) MaskedArray
@@ -1214,7 +1214,7 @@ class _DomainedBinaryOperation:
# only add back if it can be cast safely
if np.can_cast(masked_da.dtype, result.dtype, casting='safe'):
result += masked_da
- except:
+ except Exception:
pass
# Transforms to a (subclass of) MaskedArray
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index d8ea3de8c..0a68dfc7d 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -778,7 +778,7 @@ def _median(a, axis=None, out=None, overwrite_input=False):
# not necessary for scalar True/False masks
try:
np.copyto(low.mask, high.mask, where=odd)
- except:
+ except Exception:
pass
if np.issubdtype(asorted.dtype, np.inexact):
diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py
index ef5f5fd53..77aae2b94 100644
--- a/numpy/ma/mrecords.py
+++ b/numpy/ma/mrecords.py
@@ -276,7 +276,7 @@ class MaskedRecords(MaskedArray, object):
try:
# Is attr a generic attribute ?
ret = object.__setattr__(self, attr, val)
- except:
+ except Exception:
# Not a generic attribute: exit if it's not a valid field
fielddict = ndarray.__getattribute__(self, 'dtype').fields or {}
optinfo = ndarray.__getattribute__(self, '_optinfo') or {}
@@ -294,7 +294,7 @@ class MaskedRecords(MaskedArray, object):
# internal attribute.
try:
object.__delattr__(self, attr)
- except:
+ except Exception:
return ret
# Let's try to set the field
try:
diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
index 4b7fe07b6..18198d4a4 100644
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -737,7 +737,7 @@ class TestMedian(TestCase):
for axis, over in args:
try:
np.ma.median(x, axis=axis, overwrite_input=over)
- except:
+ except Exception:
raise AssertionError(msg % (mask, ndmin, axis, over))
# Invalid axis values should raise exception