summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-02-26 20:04:59 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-02-26 20:04:59 -0700
commit705bf928e1256a06019c75ee945370fbe89cdde7 (patch)
tree3e1d8ebcef67a93d8d5eeb63db1256406ae5c49f /numpy/lib/format.py
parent17774a6d58b889b6b7a25d6af5b66f2148d47f41 (diff)
downloadnumpy-705bf928e1256a06019c75ee945370fbe89cdde7.tar.gz
2to3: Use modern exception syntax.
Example: except ValueError,msg: -> except ValueError as msg:
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r--numpy/lib/format.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 1e508f3e5..bff582f7d 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -334,7 +334,7 @@ def read_array_header_1_0(fp):
# "descr" : dtype.descr
try:
d = safe_eval(header)
- except SyntaxError, e:
+ except SyntaxError as e:
msg = "Cannot parse header: %r\nException: %r"
raise ValueError(msg % (header, e))
if not isinstance(d, dict):
@@ -356,7 +356,7 @@ def read_array_header_1_0(fp):
raise ValueError(msg % (d['fortran_order'],))
try:
dtype = numpy.dtype(d['descr'])
- except TypeError, e:
+ except TypeError as e:
msg = "descr is not a valid dtype descriptor: %r"
raise ValueError(msg % (d['descr'],))