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/calculator/resolution_calculator_panel.py

    r1cf490b6 r5251ec6  
    148148        # Custom sorting 
    149149        source_list = [] 
    150         for key, _ in self.source_mass.iteritems(): 
     150        for key, _ in self.source_mass.items(): 
    151151            name_source = str(key) 
    152152            source_list.append(name_source) 
     
    667667        Execute the computation of resolution 
    668668        """ 
     669        # Clone the event before CallAfter; the event seems 
     670        # to delete the event when it is done processing, so 
     671        # the original will not be available when the call 
     672        # after method starts. 
     673        if event is not None: 
     674            event = event.Clone() 
    669675        wx.CallAfter(self.on_compute_call, event) 
    670676 
     
    753759            wx.MessageBox(msg, 'Warning') 
    754760            return 
    755             #raise ValueError, "Invalid Q Input..." 
     761            #raise ValueError("Invalid Q Input...") 
    756762 
    757763        # Validate the q inputs 
     
    934940    def _sigma_strings(self): 
    935941        """ 
    936         Recode sigmas as strins 
     942        Recode sigmas as strings 
    937943        """ 
    938944        sigma_r = self.format_number(self.resolution.sigma_1) 
     
    10821088                msg = "The numbers must be one or two (separated by ',')..." 
    10831089                self._status_info(msg, 'stop') 
    1084                 raise RuntimeError, msg 
     1090                raise RuntimeError(msg) 
    10851091 
    10861092        return new_string 
     
    10991105                value = float(string_split[ind]) 
    11001106                new_string.append(value) 
    1101             except: 
    1102                 logger.error(sys.exc_value) 
     1107            except Exception as exc: 
     1108                logger.error(exc) 
    11031109 
    11041110        return new_string 
     
    11411147                        out = self._string2inputlist(string) 
    11421148                        return out 
    1143                 except: 
    1144                     logger.error(sys.exc_value) 
     1149                except Exception as exc: 
     1150                    logger.error(exc) 
    11451151 
    11461152    def _on_xy_coordinate(self, event=None): 
     
    12691275            try: 
    12701276                basename = os.path.basename(path) 
    1271                 if basename not in self.spectrum_dic.keys(): 
     1277                if basename not in self.spectrum_dic: 
    12721278                    self.spectrum_cb.Append(basename) 
    12731279                self.spectrum_dic[basename] = self._read_file(path) 
     
    12861292        dlg = wx.FileDialog(self, 
    12871293                            "Choose a wavelength spectrum file: Intensity vs. wavelength", 
    1288                             self.parent.parent.get_save_location() , "", "*.*", wx.OPEN) 
     1294                            self.parent.parent.get_save_location() , "", "*.*", wx.FD_OPEN) 
    12891295        path = None 
    12901296        if dlg.ShowModal() == wx.ID_OK: 
     
    13181324                    wavelength.append(wave) 
    13191325                    intensity.append(intens) 
    1320                 except: 
     1326                except Exception as exc: 
    13211327                    # Skip non-data lines 
    1322                     logger.error(sys.exc_value) 
     1328                    logger.error(exc) 
    13231329 
    13241330            return [wavelength, intensity] 
Note: See TracChangeset for help on using the changeset viewer.