Index: src/sas/sascalc/pr/fit/AbstractFitEngine.py
===================================================================
--- src/sas/sascalc/pr/fit/AbstractFitEngine.py	(revision 50fcb09b3ee47cf23c26b90d9c291f41415c0aa5)
+++ src/sas/sascalc/pr/fit/AbstractFitEngine.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -251,5 +251,5 @@
             msg = "FitData1D: invalid error array "
             msg += "%d <> %d" % (np.shape(self.dy), np.size(fx))
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
         return (self.y[self.idx] - fx[self.idx]) / self.dy[self.idx], fx[self.idx]
 
Index: src/sas/sascalc/pr/fit/Loader.py
===================================================================
--- src/sas/sascalc/pr/fit/Loader.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sascalc/pr/fit/Loader.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -18,20 +18,20 @@
         self.dy = dy
         self.filename = None
-        
+
     def set_filename(self, path=None):
         """
-        Store path into a variable.If the user doesn't give 
+        Store path into a variable.If the user doesn't give
         a path as a parameter a pop-up
         window appears to select the file.
-        
+
         :param path: the path given by the user
-        
+
         """
         self.filename = path
-       
+
     def get_filename(self):
         """ return the file's path"""
         return self.filename
-    
+
     def set_values(self):
         """ Store the values loaded from file in local variables"""
@@ -42,5 +42,5 @@
             self.x = []
             self.y = []
-            self.dx = [] 
+            self.dx = []
             self.dy = []
             for line in lines:
@@ -50,5 +50,5 @@
                     y = float(toks[1])
                     dy = float(toks[2])
-                    
+
                     self.x.append(x)
                     self.y.append(y)
@@ -59,13 +59,13 @@
             # Sanity check
             if not len(self.x) == len(self.dx):
-                raise ValueError, "x and dx have different length"
+                raise ValueError("x and dx have different length")
             if not len(self.y) == len(self.dy):
-                raise ValueError, "y and dy have different length"
-            
-            
+                raise ValueError("y and dy have different length")
+
+
     def get_values(self):
         """ Return x, y, dx, dy"""
         return self.x, self.y, self.dx, self.dy
-    
+
     def load_data(self, data):
         """ Return plottable"""
@@ -77,12 +77,11 @@
         #Load its View class
         #plottable.reset_view()
-       
-    
-if __name__ == "__main__": 
+
+
+if __name__ == "__main__":
     load = Load()
     load.set_filename("testdata_line.txt")
-    print(load.get_filename()) 
+    print(load.get_filename())
     load.set_values()
     print(load.get_values())
-    
-            
+
Index: src/sas/sascalc/pr/fit/expression.py
===================================================================
--- src/sas/sascalc/pr/fit/expression.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sascalc/pr/fit/expression.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -59,5 +59,5 @@
     occur multiple times.  The return value is a set with the elements in
     no particular order.
-    
+
     This is the first step in computing a dependency graph.
     """
@@ -81,5 +81,5 @@
         offset = end
     pieces.append(expr[offset:])
-    
+
     # Join the pieces and return them
     return "".join(pieces)
@@ -88,5 +88,5 @@
     """
     Returns a list of pair-wise dependencies from the parameter expressions.
-    
+
     For example, if p3 = p1+p2, then find_dependencies([p1,p2,p3]) will
     return [(p3,p1),(p3,p2)].  For base expressions without dependencies,
@@ -110,5 +110,5 @@
     """
     Find the parameter substitution we need so that expressions can
-    be evaluated without having to traverse a chain of 
+    be evaluated without having to traverse a chain of
     model.layer.parameter.value
     """
@@ -122,5 +122,5 @@
     return definition, substitution
 
-def no_constraints(): 
+def no_constraints():
     """
     This parameter set has no constraints between the parameters.
@@ -163,10 +163,10 @@
 
     Parameter names are assumed to contain only _.a-zA-Z0-9#[]
-    
+
     Both names are provided for inverse functions, e.g., acos and arccos.
 
     Should try running the function to identify syntax errors before
     running it in a fit.
-    
+
     Use help(fn) to see the code generated for the returned function fn.
     dis.dis(fn) will show the corresponding python vm instructions.
@@ -239,5 +239,5 @@
         if independent == emptyset:
             cycleset = ", ".join(str(s) for s in left)
-            raise ValueError,"Cyclic dependencies amongst %s"%cycleset
+            raise ValueError("Cyclic dependencies amongst %s"%cycleset)
 
         # The possibly resolvable items are those that depend on the independents
@@ -267,8 +267,8 @@
         n.sort()
         items = list(items); items.sort()
-        raise Exception,"%s expect %s to contain %s for %s"%(msg,n,items,pairs)
+        raise ValueError("%s expect %s to contain %s for %s"%(msg,n,items,pairs))
     for lo,hi in pairs:
         if lo in n and hi in n and n.index(lo) >= n.index(hi):
-            raise Exception,"%s expect %s before %s in %s for %s"%(msg,lo,hi,n,pairs)
+            raise ValueError("%s expect %s before %s in %s for %s"%(msg,lo,hi,n,pairs))
 
 def test_deps():
@@ -288,7 +288,10 @@
     # Cycle test
     pairs = [(1,4),(4,3),(4,5),(5,1)]
-    try: n = order_dependencies(pairs)
-    except ValueError: pass
-    else: raise Exception,"test3 expect ValueError exception for %s"%(pairs,)
+    try:
+        n = order_dependencies(pairs)
+    except ValueError:
+        pass
+    else:
+        raise Exception("test3 expect ValueError exception for %s"%(pairs,))
 
     # large test for gross speed check
@@ -308,8 +311,8 @@
     import inspect, dis
     import math
-    
+
     symtab = {'a.b.x':1, 'a.c':2, 'a.b':3, 'b.x':4}
     expr = 'a.b.x + sin(4*pi*a.c) + a.b.x/a.b'
-    
+
     # Check symbol lookup
     assert _symbols(expr, symtab) == set([1,2,3])
@@ -357,5 +360,5 @@
     expected = 2*math.pi*math.sin(5/.1875) + 6
     assert p2.value == expected,"Value was %s, not %s"%(p2.value,expected)
-    
+
     # Check empty dependency set doesn't crash
     fn = compile_constraints(*world(p1,p3))
@@ -381,8 +384,8 @@
     fn()
     assert p5.value == 2.07,"Value for %s was %s"%(p5.expression,p5.value)
-    
+
 
     # Verify that we capture invalid expressions
-    for expr in ['G4.cage', 'M0.cage', 'M1.G1 + *2', 
+    for expr in ['G4.cage', 'M0.cage', 'M1.G1 + *2',
                  'piddle',
                  '5; import sys; print "p0wned"',
Index: src/sas/sascalc/pr/invertor.py
===================================================================
--- src/sas/sascalc/pr/invertor.py	(revision cb62bd55ae79395ac6e01d8b2077f4d496625c41)
+++ src/sas/sascalc/pr/invertor.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -148,5 +148,5 @@
                 msg = "Invertor: one of your q-values is zero. "
                 msg += "Delete that entry before proceeding"
-                raise ValueError, msg
+                raise ValueError(msg)
             return self.set_x(value)
         elif name == 'y':
@@ -159,5 +159,5 @@
                 msg = "Invertor: d_max must be greater than zero."
                 msg += "Correct that entry before proceeding"
-                raise ValueError, msg
+                raise ValueError(msg)
             return self.set_dmax(value)
         elif name == 'q_min':
@@ -181,5 +181,5 @@
                 return self.set_est_bck(0)
             else:
-                raise ValueError, "Invertor: est_bck can only be True or False"
+                raise ValueError("Invertor: est_bck can only be True or False")
 
         return Cinvertor.__setattr__(self, name, value)
@@ -331,5 +331,5 @@
         if self.is_valid() <= 0:
             msg = "Invertor.invert: Data array are of different length"
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
         p = np.ones(nfunc)
@@ -364,5 +364,5 @@
         if self.is_valid() <= 0:
             msg = "Invertor.invert: Data arrays are of different length"
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
         p = np.ones(nfunc)
@@ -448,5 +448,5 @@
         if self.is_valid() < 0:
             msg = "Invertor: invalid data; incompatible data lengths."
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
         self.nfunc = nfunc
@@ -473,5 +473,5 @@
             self._get_matrix(nfunc, nq, a, b)
         except:
-            raise RuntimeError, "Invertor: could not invert I(Q)\n  %s" % sys.exc_value
+            raise RuntimeError("Invertor: could not invert I(Q)\n  %s" % sys.exc_value)
 
         # Perform the inversion (least square fit)
@@ -756,6 +756,6 @@
             except:
                 msg = "Invertor.from_file: corrupted file\n%s" % sys.exc_value
-                raise RuntimeError, msg
+                raise RuntimeError(msg)
         else:
             msg = "Invertor.from_file: '%s' is not a file" % str(path)
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
