From ce0e2c139bb7547339f12a403e1100dab3774c24 Mon Sep 17 00:00:00 2001 From: Worros Date: Sat, 31 Oct 2009 08:55:54 +0800 Subject: [PATCH] Revert "Print out actual exception when import fails" This reverts commit 626ff49eb41e5bb28d8db33277f3fe726d90aef5. Turns out this commit is python 2.6 syntax --- pyfpdb/GuiGraphViewer.py | 3 +-- pyfpdb/GuiSessionViewer.py | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index 739a8f18..4011ba00 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -32,12 +32,11 @@ try: from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar from numpy import arange, cumsum from pylab import * -except ImportError as inst: +except ImportError: 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 and HUD are NOT affected by this problem.""" - print "ImportError: %s" % inst.args import fpdb_import import Database diff --git a/pyfpdb/GuiSessionViewer.py b/pyfpdb/GuiSessionViewer.py index 5711cb89..7695cf73 100755 --- a/pyfpdb/GuiSessionViewer.py +++ b/pyfpdb/GuiSessionViewer.py @@ -37,10 +37,11 @@ try: # from matplotlib.dates import DateFormatter, WeekdayLocator, HourLocator, \ # DayLocator, MONDAY, timezone -except ImportError as inst: +except: + err = traceback.extract_tb(sys.exc_info()[2])[-1] + print "***Error: "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1]) 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 + print """This is of no consequence as the module currently doesn't do anything.""" import Card import fpdb_import