summaryrefslogtreecommitdiff
path: root/numpy/testing/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r--numpy/testing/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index f2588788d..133330a12 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -252,8 +252,8 @@ def build_err_msg(arrays, err_msg, header='Items are not equal:',
try:
r = r_func(a)
- except:
- r = '[repr failed]'
+ except Exception as exc:
+ r = '[repr failed for <{}>: {}]'.format(type(a).__name__, exc)
if r.count('\n') > 3:
r = '\n'.join(r.splitlines()[:3])
r += '...'