Print out actual exception when import fails
This commit is contained in:
		
							parent
							
								
									d80360b3bb
								
							
						
					
					
						commit
						626ff49eb4
					
				| 
						 | 
				
			
			@ -32,11 +32,12 @@ try:
 | 
			
		|||
    from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar
 | 
			
		||||
    from numpy import arange, cumsum
 | 
			
		||||
    from pylab import *
 | 
			
		||||
except ImportError:
 | 
			
		||||
except ImportError as 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 
 | 
			
		||||
         and HUD are NOT affected by this problem."""
 | 
			
		||||
    print "ImportError: %s" % inst.args
 | 
			
		||||
 | 
			
		||||
import fpdb_import
 | 
			
		||||
import Database
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,11 +37,10 @@ try:
 | 
			
		|||
#    from matplotlib.dates import  DateFormatter, WeekdayLocator, HourLocator, \
 | 
			
		||||
#     DayLocator, MONDAY, timezone
 | 
			
		||||
 | 
			
		||||
except:
 | 
			
		||||
    err = traceback.extract_tb(sys.exc_info()[2])[-1]
 | 
			
		||||
    print "***Error: "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
 | 
			
		||||
except ImportError as inst:
 | 
			
		||||
    print """Failed to load numpy in Session Viewer"""
 | 
			
		||||
    print """This is of no consequence as the module currently doesn't do anything."""
 | 
			
		||||
    print """This is of no consequence as the page is broken and only of interest to developers."""
 | 
			
		||||
    print "ImportError: %s" % inst.args
 | 
			
		||||
 | 
			
		||||
import Card
 | 
			
		||||
import fpdb_import
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user