diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-02-26 20:04:59 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-02-26 20:04:59 -0700 |
commit | 705bf928e1256a06019c75ee945370fbe89cdde7 (patch) | |
tree | 3e1d8ebcef67a93d8d5eeb63db1256406ae5c49f /numpy/testing | |
parent | 17774a6d58b889b6b7a25d6af5b66f2148d47f41 (diff) | |
download | numpy-705bf928e1256a06019c75ee945370fbe89cdde7.tar.gz |
2to3: Use modern exception syntax.
Example: except ValueError,msg: -> except ValueError as msg:
Diffstat (limited to 'numpy/testing')
-rw-r--r-- | numpy/testing/numpytest.py | 2 | ||||
-rw-r--r-- | numpy/testing/utils.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py index 683df7a01..f72626cf0 100644 --- a/numpy/testing/numpytest.py +++ b/numpy/testing/numpytest.py @@ -43,7 +43,7 @@ def importall(package): name = package_name+'.'+subpackage_name try: exec 'import %s as m' % (name) - except Exception, msg: + except Exception as msg: print 'Failed importing %s: %s' %(name, msg) continue importall(m) diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 16ed0f803..2d3965594 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) |