Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SMIRR Jean-Loup
igor
Commits
4776df19
Commit
4776df19
authored
Jul 21, 2012
by
W. Trevor King
Browse files
Convert exception.message -> exception.args[0] for Python 3 compatibility.
Python 3 exceptions no longer have a .message attribute.
parent
5a636a00
Changes
1
Hide whitespace changes
Inline
Side-by-side
igor/igorpy.py
View file @
4776df19
...
...
@@ -16,6 +16,7 @@ PTN003.ifn and TN003.ifn.
from
__future__
import
absolute_import
import
io
as
_io
import
re
as
_re
import
sys
as
_sys
import
numpy
as
_numpy
...
...
@@ -222,9 +223,9 @@ def load(filename, **kwargs):
try
:
packed_experiment
=
_load
(
filename
)
except
ValueError
as
e
:
if
e
.
message
.
startswith
(
'not enough data for the next record header'
):
if
e
.
args
[
0
]
.
startswith
(
'not enough data for the next record header'
):
raise
IOError
(
'invalid record header; bad pxp file?'
)
elif
e
.
message
.
startswith
(
'not enough data for the next record'
):
elif
e
.
args
[
0
]
.
startswith
(
'not enough data for the next record'
):
raise
IOError
(
'final record too long; bad pxp file?'
)
raise
return
_convert
(
packed_experiment
,
**
kwargs
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment