From 4776df191fd24648ba06aca82725da04dff5eccd Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 21 Jul 2012 09:48:09 -0400 Subject: [PATCH] Convert exception.message -> exception.args[0] for Python 3 compatibility. Python 3 exceptions no longer have a .message attribute. --- igor/igorpy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) -- 2.26.2