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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index 16ed0f803..ecf9fb6bd 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -643,7 +643,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
names=('x', 'y'))
if not cond :
raise AssertionError(msg)
- except ValueError, e:
+ except ValueError as e:
import traceback
efmt = traceback.format_exc()
header = 'error during assertion:\n\n%s\n\n%s' % (efmt, header)
@@ -881,7 +881,7 @@ def assert_array_less(x, y, err_msg='', verbose=True):
header='Arrays are not less-ordered')
def runstring(astr, dict):
- exec astr in dict
+ exec(astr, dict)
def assert_string_equal(actual, desired):
"""
@@ -1108,7 +1108,7 @@ def measure(code_str,times=1,label=None):
elapsed = jiffies()
while i < times:
i += 1
- exec code in globs,locs
+ exec(code, globs,locs)
elapsed = jiffies() - elapsed
return 0.01*elapsed