From 5e6899a29e867e1e7c66a961433a4915d3a7e8c2 Mon Sep 17 00:00:00 2001 From: grindi Date: Sat, 31 Oct 2009 17:48:48 +0300 Subject: [PATCH] Print out actual exception when import fails. Python 2.5 compatible --- pyfpdb/GuiGraphViewer.py | 2 +- pyfpdb/GuiSessionViewer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index 9ce5c17a..670554e7 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -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 diff --git a/pyfpdb/GuiSessionViewer.py b/pyfpdb/GuiSessionViewer.py index 5711cb89..0d391102 100755 --- a/pyfpdb/GuiSessionViewer.py +++ b/pyfpdb/GuiSessionViewer.py @@ -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