From 1608e53072b035bd40de7a202e75354f0e802120 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sat, 3 Jun 2017 13:41:26 +0100 Subject: BUG: KeyboardInterrupt is swallowed all over the place Bare except is very rarely the right thing --- numpy/core/numeric.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 1dde02400..9073ca5ff 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1278,7 +1278,7 @@ def tensordot(a, b, axes=2): """ try: iter(axes) - except: + except Exception: axes_a = list(range(-axes, 0)) axes_b = list(range(0, axes)) else: @@ -2597,7 +2597,7 @@ def array_equal(a1, a2): """ try: a1, a2 = asarray(a1), asarray(a2) - except: + except Exception: return False if a1.shape != a2.shape: return False @@ -2641,11 +2641,11 @@ def array_equiv(a1, a2): """ try: a1, a2 = asarray(a1), asarray(a2) - except: + except Exception: return False try: multiarray.broadcast(a1, a2) - except: + except Exception: return False return bool(asarray(a1 == a2).all()) -- cgit v1.2.1