From: W. Trevor King Date: Sat, 21 Jul 2012 13:48:09 +0000 (-0400) Subject: Convert exception.message -> exception.args[0] for Python 3 compatibility. X-Git-Tag: v0.2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4776df191fd24648ba06aca82725da04dff5eccd;p=igor.git Convert exception.message -> exception.args[0] for Python 3 compatibility. Python 3 exceptions no longer have a .message attribute. --- diff --git a/igor/igorpy.py b/igor/igorpy.py index a552edb..ede660f 100644 --- a/igor/igorpy.py +++ b/igor/igorpy.py @@ -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)