1212import numpy as np
1313import pyqtgraph as pg
1414import pyqtgraph .exporters
15- import exceptions
15+ # import exceptions
1616import time
1717import copy
1818import datetime as dt
@@ -262,7 +262,7 @@ def openLivePlots(self, twoPlots, onePlots, fresh, c = None):
262262 print ("Following error was thrown: " )
263263 print (str (inst ))
264264 print ("Error thrown on line: " )
265- print (sys .exc_traceback . tb_lineno )
265+ print (sys .exc_info ()[ 2 ] )
266266 plt1 , plt2 = len (self .existing1DPlotDict ), len (self .existing2DPlotDict )
267267
268268 try :
@@ -300,7 +300,7 @@ def openLivePlots(self, twoPlots, onePlots, fresh, c = None):
300300 print ("Following error was thrown: " )
301301 print (str (inst ))
302302 print ("Error thrown on line: " )
303- print (" sys.exc_traceback.tb_lineno" )
303+ print (sys .exc_info ()[ 2 ] )
304304 elif fresh == 1 :
305305 try :
306306 x0 , y0 = 450 , 25
@@ -327,7 +327,7 @@ def openLivePlots(self, twoPlots, onePlots, fresh, c = None):
327327 print ("Following error was thrown: " )
328328 print (str (inst ))
329329 print ("Error thrown on line: " )
330- print (sys .exc_traceback . tb_lineno )
330+ print (sys .exc_info ()[ 2 ] )
331331
332332 self .allowPlot = True
333333
@@ -345,7 +345,7 @@ def openSavedPlots(self, file, dir, allPlots, dim):
345345 print ("Following error was thrown: " )
346346 print (str (inst ))
347347 print ("Error thrown on line: " )
348- print (sys .exc_traceback . tb_lineno )
348+ print (sys .exc_info ()[ 2 ] )
349349 elif dim == 1 :
350350 for plot in allPlots :
351351 try :
@@ -358,7 +358,7 @@ def openSavedPlots(self, file, dir, allPlots, dim):
358358 print ("Following error was thrown: " )
359359 print (str (inst ))
360360 print ("Error thrown on line: " )
361- print (sys .exc_traceback . tb_lineno )
361+ print (sys .exc_info ()[ 2 ] )
362362
363363 def plotLiveData (self ):
364364 self .dvExplorer = dataVaultExplorer (self .reactor , 'live' , self .listenTo , self )
@@ -616,7 +616,7 @@ def setupListener(self, c):
616616 print ("Following error was thrown: " )
617617 print (str (inst ))
618618 print ("Error thrown on line: " )
619- print (sys .exc_traceback . tb_lineno )
619+ print (sys .exc_info ()[ 2 ] )
620620 @inlineCallbacks
621621 def addListen (self , c ):
622622 yield self .dv .signal__data_available (self .id )
@@ -710,7 +710,7 @@ def autoHistFunc(self, state):
710710 print ("Following error was thrown: " )
711711 print (str (inst ))
712712 print ("Error thrown on line: " )
713- print (sys .exc_traceback . tb_lineno )
713+ print (sys .exc_info ()[ 2 ] )
714714
715715 def toggleTraceFunc (self ):
716716 jj = self .i % 2
@@ -969,7 +969,7 @@ def updatePlot(self, c, signal):
969969 print ("Following error was thrown: " )
970970 print (str (inst ))
971971 print ("Error thrown on line: " )
972- print (sys .exc_traceback . tb_lineno )
972+ print (sys .exc_info ()[ 2 ] )
973973 @inlineCallbacks
974974 def plotMore (self , newData , x_ind , y_ind , z_ind , c ):
975975 yield self .sleep (0.1 )
@@ -1187,7 +1187,7 @@ def setupListener(self, c):
11871187 print ("Following error was thrown: " )
11881188 print (str (inst ))
11891189 print ("Error thrown on line: " )
1190- print (sys .exc_traceback . tb_lineno )
1190+ print (sys .exc_info ()[ 2 ] )
11911191
11921192 @inlineCallbacks
11931193 def addListen (self , c ):
@@ -1258,7 +1258,7 @@ def plotMore(self, x_ind, y_ind, c):
12581258 print ("Following error was thrown: " )
12591259 print (str (inst ))
12601260 print ("Error thrown on line: " )
1261- print (sys .exc_traceback . tb_lineno )
1261+ print (sys .exc_info ()[ 2 ] )
12621262 def sleep (self ,secs ):
12631263 d = Deferred ()
12641264 self .reactor .callLater (secs ,d .callback ,'Sleeping' )
@@ -1888,7 +1888,7 @@ def loadData(self, c):
18881888 print ("Following error was thrown: " )
18891889 print (str (inst ))
18901890 print ("Error thrown on line: " )
1891- print (sys .exc_traceback . tb_lineno )
1891+ print (sys .exc_info ()[ 2 ] )
18921892
18931893 self .mainPlot .setImage (self .plotData , autoRange = True , autoLevels = True , pos = [self .x0 , self .y0 ],scale = [self .xscale , self .yscale ])
18941894
@@ -2095,7 +2095,7 @@ def genPDF(self, folder, fileName, header, plot):
20952095 print ("Following error was thrown: " )
20962096 print (str (inst ))
20972097 print ("Error thrown on line: " )
2098- print (sys .exc_traceback . tb_lineno )
2098+ print (sys .exc_info ()[ 2 ] )
20992099
21002100 if plot < 3 :
21012101 self .print_pdf (html , str (fileName ))
@@ -2113,7 +2113,7 @@ def genPDF(self, folder, fileName, header, plot):
21132113 print ("Following error was thrown: " )
21142114 print (str (inst ))
21152115 print ("Error thrown on line: " )
2116- print (sys .exc_traceback . tb_lineno )
2116+ print (sys .exc_info ()[ 2 ] )
21172117 tmp_loc = ''
21182118 yield self .sleep (0.5 )
21192119 try :
@@ -2125,7 +2125,7 @@ def genPDF(self, folder, fileName, header, plot):
21252125 print ("Following error was thrown: " )
21262126 print (str (inst ))
21272127 print ("Error thrown on line: " )
2128- print (sys .exc_traceback . tb_lineno )
2128+ print (sys .exc_info ()[ 2 ] )
21292129 os .chdir (init_loc )
21302130
21312131
@@ -2640,7 +2640,7 @@ def initPlot(self, c = None):
26402640 print ("Following error was thrown: " )
26412641 print (str (inst ))
26422642 print ("Error thrown on line: " )
2643- print (sys .exc_traceback . tb_lineno )
2643+ print (sys .exc_info ()[ 2 ] )
26442644 elif self .fresh == 2 :
26452645 print ("2D Info: " , self .plot2DInfo )
26462646 print ("1D Info: " , self .plot1DInfo )
0 commit comments