Ignore:
Timestamp:
Oct 11, 2018 2: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/plottools/plottables.py

    r2469df7 r5251ec6  
    389389 
    390390        """ 
    391         raise NotImplemented, "Not a valid transform" 
     391        raise NotImplemented("Not a valid transform") 
    392392 
    393393    # Related issues 
     
    689689                msg = "Plottable.View: Given x and dx are not" 
    690690                msg += " of the same length" 
    691                 raise ValueError, msg 
     691                raise ValueError(msg) 
    692692            # Check length of y array 
    693693            if not len(y) == len(x): 
    694694                msg = "Plottable.View: Given y " 
    695695                msg += "and x are not of the same length" 
    696                 raise ValueError, msg 
     696                raise ValueError(msg) 
    697697 
    698698            if dy is not None and not len(dy) == 0 and not len(y) == len(dy): 
    699699                msg = "Plottable.View: Given y and dy are not of the same " 
    700700                msg += "length: len(y)=%s, len(dy)=%s" % (len(y), len(dy)) 
    701                 raise ValueError, msg 
     701                raise ValueError(msg) 
    702702            self.x = [] 
    703703            self.y = [] 
     
    734734                msg = "Plottable.View: transformed x " 
    735735                msg += "and y are not of the same length" 
    736                 raise ValueError, msg 
     736                raise ValueError(msg) 
    737737            if has_err_x and not (len(self.x) == len(self.dx)): 
    738738                msg = "Plottable.View: transformed x and dx" 
    739739                msg += " are not of the same length" 
    740                 raise ValueError, msg 
     740                raise ValueError(msg) 
    741741            if has_err_y and not (len(self.y) == len(self.dy)): 
    742742                msg = "Plottable.View: transformed y" 
    743743                msg += " and dy are not of the same length" 
    744                 raise ValueError, msg 
     744                raise ValueError(msg) 
    745745            # Check that negative values are not plot on x and y axis for 
    746746            # log10 transformation 
     
    812812                        tempy.append(self.y[i]) 
    813813                        tempdy.append(self.dy[i]) 
    814                 except: 
     814                except Exception as exc: 
    815815                    logger.error("check_data_logX: skipping point x %g", self.x[i]) 
    816                     logger.error(sys.exc_value) 
     816                    logger.error(exc) 
    817817            self.x = tempx 
    818818            self.y = tempy 
     
    842842                        tempy.append(self.y[i]) 
    843843                        tempdy.append(self.dy[i]) 
    844                 except: 
     844                except Exception as exc: 
    845845                    logger.error("check_data_logY: skipping point %g", self.y[i]) 
    846                     logger.error(sys.exc_value) 
     846                    logger.error(exc) 
    847847 
    848848            self.x = tempx 
     
    996996            self.zmax = zmax 
    997997        else: 
    998             raise "zmin is greater or equal to zmax " 
     998            raise("zmin is greater or equal to zmax ") 
    999999 
    10001000    def render(self, plot, **kw): 
     
    11081108        Plottable.__init__(self) 
    11091109        msg = "Theory1D is no longer supported, please use Data1D and change symbol.\n" 
    1110         raise DeprecationWarning, msg 
     1110        raise DeprecationWarning(msg) 
    11111111 
    11121112class Fit1D(Plottable): 
Note: See TracChangeset for help on using the changeset viewer.