Print out actual exception when import fails. Python 2.5 compatible

This commit is contained in:
grindi 2009-10-31 17:48:48 +03:00
parent 19b46e8444
commit 5e6899a29e
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ try:
from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar
from numpy import arange, cumsum
from pylab import *
except ImportError as inst:
except ImportError, inst:
print """Failed to load libs for graphing, graphing will not function. Please in
stall numpy and matplotlib if you want to use graphs."""
print """This is of no consequence for other parts of the program, e.g. import

View File

@ -37,7 +37,7 @@ try:
# from matplotlib.dates import DateFormatter, WeekdayLocator, HourLocator, \
# DayLocator, MONDAY, timezone
except ImportError as inst:
except ImportError, inst:
print """Failed to load numpy in Session Viewer"""
print """This is of no consequence as the page is broken and only of interest to developers."""
print "ImportError: %s" % inst.args