Ignore:
Timestamp:
Oct 11, 2018 2:20:56 PM (12 months ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1249
Children:
98b9f32
Parents:
67ed543
Message:

improved support for py37 in sasgui

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py

    rd788619 r5251ec6  
    1717from sas.sasgui.guiframe.events import StatusEvent 
    1818from sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator 
    19 from calculator_widgets import OutputTextCtrl 
    20 from calculator_widgets import InterActiveOutputTextCtrl 
    2119from sas.sasgui.perspectives.calculator import calculator_widgets as widget 
    2220from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
     21from .calculator_widgets import OutputTextCtrl 
     22from .calculator_widgets import InterActiveOutputTextCtrl 
    2323 
    2424_BOX_WIDTH = 76 
     
    163163 
    164164        dlg = wx.FileDialog(self, "Choose a file", location, 
    165                             "", wildcard, wx.OPEN) 
     165                            "", wildcard, wx.FD_OPEN) 
    166166        if dlg.ShowModal() == wx.ID_OK: 
    167167            path = dlg.GetPath() 
     
    223223            self.reader.queue() 
    224224            self.load_update() 
    225         except: 
     225        except Exception as exc: 
    226226            if self.parent.parent is None: 
    227227                return 
    228             msg = "Slit Length Calculator: %s" % (sys.exc_value) 
     228            msg = "Slit Length Calculator: %s" % exc 
    229229            wx.PostEvent(self.parent.parent, 
    230230                          StatusEvent(status=msg, type='stop')) 
     
    264264            if x == [] or  x is None or y == [] or y is None: 
    265265                msg = "The current data is empty please check x and y" 
    266                 raise ValueError, msg 
     266                raise ValueError(msg) 
    267267            slit_length_calculator = SlitlengthCalculator() 
    268268            slit_length_calculator.set_data(x=x, y=y) 
    269269            slit_length = slit_length_calculator.calculate_slit_length() 
    270         except: 
     270        except Exception as exc: 
    271271            if self.parent.parent is None: 
    272272                return 
    273             msg = "Slit Size Calculator: %s" % (sys.exc_value) 
     273            msg = "Slit Size Calculator: %s" % exc 
    274274            wx.PostEvent(self.parent.parent, 
    275275                          StatusEvent(status=msg, type='stop')) 
Note: See TracChangeset for help on using the changeset viewer.