diff options
| author | Charles Harris <charlesr.harris@gmail.com> | 2013-03-01 08:36:46 -0700 |
|---|---|---|
| committer | Charles Harris <charlesr.harris@gmail.com> | 2013-03-01 08:36:46 -0700 |
| commit | 02cfcb99bc976a0bfc39529999e2a0200fb9cc2a (patch) | |
| tree | a2a2210d560d5696e47a5dcf5d969faa8d21ad79 /numpy/core | |
| parent | d1e692d70da7532b02d752d0842987333bd76c70 (diff) | |
| parent | 3655b732bd08022dab8498b44191d6c4049bc7a8 (diff) | |
| download | numpy-02cfcb99bc976a0bfc39529999e2a0200fb9cc2a.tar.gz | |
Merge branch '2to3-raise'
Use modern raise syntax for python 3 compatibility.
* 2to3-raise:
2to3: Apply `raise` fixes. Closes #3077.
Diffstat (limited to 'numpy/core')
| -rw-r--r-- | numpy/core/code_generators/generate_numpy_api.py | 4 | ||||
| -rw-r--r-- | numpy/core/records.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/code_generators/generate_numpy_api.py b/numpy/core/code_generators/generate_numpy_api.py index 7cd4b9f6a..463fe1695 100644 --- a/numpy/core/code_generators/generate_numpy_api.py +++ b/numpy/core/code_generators/generate_numpy_api.py @@ -221,8 +221,8 @@ def do_generate_api(targets, sources): multiarray_api_dict[name] = TypeApi(name, index, 'PyTypeObject', api_name) if len(multiarray_api_dict) != len(multiarray_api_index): - raise AssertionError, "Multiarray API size mismatch %d %d" % \ - (len(multiarray_api_dict), len(multiarray_api_index)) + raise AssertionError("Multiarray API size mismatch %d %d" % + (len(multiarray_api_dict), len(multiarray_api_index))) extension_list = [] for name, index in genapi.order_dict(multiarray_api_index): diff --git a/numpy/core/records.py b/numpy/core/records.py index 964b4a54e..2e55c48fb 100644 --- a/numpy/core/records.py +++ b/numpy/core/records.py @@ -436,7 +436,7 @@ class recarray(ndarray): fielddict = ndarray.__getattribute__(self, 'dtype').fields or {} if attr not in fielddict: exctype, value = sys.exc_info()[:2] - raise exctype, value + raise exctype(value) else: fielddict = ndarray.__getattribute__(self, 'dtype').fields or {} if attr not in fielddict: |
