diff options
Diffstat (limited to 'numpy/testing')
-rw-r--r-- | numpy/testing/numpytest.py | 2 | ||||
-rw-r--r-- | numpy/testing/utils.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py index f72626cf0..200c88b03 100644 --- a/numpy/testing/numpytest.py +++ b/numpy/testing/numpytest.py @@ -42,7 +42,7 @@ def importall(package): continue name = package_name+'.'+subpackage_name try: - exec 'import %s as m' % (name) + exec('import %s as m' % (name)) except Exception as msg: print 'Failed importing %s: %s' %(name, msg) continue diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 2d3965594..ecf9fb6bd 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -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 |