Ignore:
Timestamp:
Oct 11, 2018 12:20:56 PM (6 years 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/pr/inversion_panel.py

    rcb62bd5 r5251ec6  
    55__revision__ = "$Revision: 1193 $" 
    66 
    7 import wx 
    87import os 
    98import sys 
    109import logging 
     10 
     11import wx 
    1112from wx.lib.scrolledpanel import ScrolledPanel 
     13 
    1214from sas.sasgui.guiframe.events import StatusEvent 
    1315from sas.sasgui.guiframe.panel_base import PanelBase 
    14 from inversion_state import InversionState 
    15 from pr_widgets import PrTextCtrl 
    16 from pr_widgets import DataFileTextCtrl 
    17 from pr_widgets import OutputTextCtrl 
    1816from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
     17 
     18from .inversion_state import InversionState 
     19from .pr_widgets import PrTextCtrl 
     20from .pr_widgets import DataFileTextCtrl 
     21from .pr_widgets import OutputTextCtrl 
    1922 
    2023logger = logging.getLogger(__name__) 
     
    752755        except ValueError: 
    753756            logger.error("InversionControl._on_accept_alpha got a value that was not a number: %s" % alpha ) 
    754         except: 
     757        except Exception as exc: 
    755758            # No estimate or bad estimate, either do nothing 
    756             logger.error("InversionControl._on_accept_alpha: %s" % sys.exc_value) 
     759            logger.error("InversionControl._on_accept_alpha: %s" % exc) 
    757760 
    758761    def _on_accept_nterms(self, evt): 
     
    768771        except ValueError: 
    769772            logger.error("InversionControl._on_accept_nterms got a value that was not a number: %s" % nterms ) 
    770         except: 
     773        except Exception as exc: 
    771774            # No estimate or bad estimate, either do nothing 
    772             logger.error("InversionControl._on_accept_nterms: %s" % sys.exc_value) 
     775            logger.error("InversionControl._on_accept_nterms: %s" % exc) 
    773776 
    774777    def clear_panel(self): 
     
    901904                message += "than the number of points" 
    902905                wx.PostEvent(self._manager.parent, StatusEvent(status=message)) 
    903                 raise ValueError, message 
     906                raise ValueError(message) 
    904907            self.nfunc_ctl.SetBackgroundColour(wx.WHITE) 
    905908            self.nfunc_ctl.Refresh() 
     
    957960        Invoke the d_max exploration dialog 
    958961        """ 
    959         from explore_dialog import ExploreDialog 
     962        from .explore_dialog import ExploreDialog 
    960963        if self._manager._last_pr is not None: 
    961964            pr = self._manager._create_plot_pr() 
     
    10081011                self._on_invert(None) 
    10091012                self._set_analysis(True) 
    1010             except: 
    1011                 msg = "InversionControl._change_file: %s" % sys.exc_value 
     1013            except Exception as exc: 
     1014                msg = "InversionControl._change_file: %s" % exc 
    10121015                logger.error(msg) 
    10131016 
Note: See TracChangeset for help on using the changeset viewer.