summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/function_base.py2
-rw-r--r--numpy/lib/index_tricks.py2
-rw-r--r--numpy/lib/npyio.py2
-rw-r--r--numpy/lib/tests/test_format.py2
-rw-r--r--numpy/lib/tests/test_function_base.py2
-rw-r--r--numpy/lib/tests/test_regression.py6
-rw-r--r--numpy/lib/utils.py4
7 files changed, 10 insertions, 10 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 6dddbc11b..1e6223e7c 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -4531,7 +4531,7 @@ def add_newdoc(place, obj, doc):
elif isinstance(doc, list):
for val in doc:
add_docstring(getattr(new, val[0]), val[1].strip())
- except:
+ except Exception:
pass
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index 003774ce2..950f77175 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -299,7 +299,7 @@ class AxisConcatenator(object):
if len(vec) == 3:
trans1d = int(vec[2])
continue
- except:
+ except Exception:
raise ValueError("unknown special directive")
try:
axis = int(item)
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index dc1c951e7..cb3b7534d 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -424,7 +424,7 @@ def load(file, mmap_mode=None, allow_pickle=True, fix_imports=True,
"non-pickled data")
try:
return pickle.load(fid, **pickle_kwargs)
- except:
+ except Exception:
raise IOError(
"Failed to interpret file %s as a pickle" % repr(file))
finally:
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py
index 93727ef0c..155732882 100644
--- a/numpy/lib/tests/test_format.py
+++ b/numpy/lib/tests/test_format.py
@@ -811,7 +811,7 @@ def test_large_file_support():
# avoid actually writing 5GB
import subprocess as sp
sp.check_call(["truncate", "-s", "5368709120", tf_name])
- except:
+ except Exception:
raise SkipTest("Could not create 5GB large file")
# write a small array to the end
with open(tf_name, "wb") as f:
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 4f21e261f..7479e30b3 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1067,7 +1067,7 @@ class TestVectorize(TestCase):
import random
try:
vectorize(random.randrange) # Should succeed
- except:
+ except Exception:
raise AssertionError()
def test_keywords2_ticket_2100(self):
diff --git a/numpy/lib/tests/test_regression.py b/numpy/lib/tests/test_regression.py
index ee50dcfa4..ad685946b 100644
--- a/numpy/lib/tests/test_regression.py
+++ b/numpy/lib/tests/test_regression.py
@@ -174,7 +174,7 @@ class TestRegression(TestCase):
try:
try:
np.who({'foo': np.array(1)})
- except:
+ except Exception:
raise AssertionError("ticket #1243")
finally:
sys.stdout.close()
@@ -206,7 +206,7 @@ class TestRegression(TestCase):
dlist = [np.float64, np.int32, np.int32]
try:
append_fields(base, names, data, dlist)
- except:
+ except Exception:
raise AssertionError()
def test_loadtxt_fields_subarrays(self):
@@ -238,7 +238,7 @@ class TestRegression(TestCase):
a = np.zeros(2, dtype=np.bool)
try:
np.nansum(a)
- except:
+ except Exception:
raise AssertionError()
def test_py3_compat(self):
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index fad159c7e..6e150add3 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -557,7 +557,7 @@ def info(object=None, maxwidth=76, output=sys.stdout, toplevel='numpy'):
if len(arglist) > 1:
arglist[1] = "("+arglist[1]
arguments = ", ".join(arglist[1:])
- except:
+ except Exception:
pass
if len(name+arguments) > maxwidth:
@@ -689,7 +689,7 @@ def source(object, output=sys.stdout):
try:
print("In file: %s\n" % inspect.getsourcefile(object), file=output)
print(inspect.getsource(object), file=output)
- except:
+ except Exception:
print("Not available for this object.", file=output)