Index: src/sas/sascalc/fit/AbstractFitEngine.py
===================================================================
--- src/sas/sascalc/fit/AbstractFitEngine.py	(revision 50fcb09b3ee47cf23c26b90d9c291f41415c0aa5)
+++ src/sas/sascalc/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/fit/Loader.py
===================================================================
--- src/sas/sascalc/fit/Loader.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sascalc/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/fit/MultiplicationModel.py
===================================================================
--- src/sas/sascalc/fit/MultiplicationModel.py	(revision 7432acb919f4013119ca918a73350297e0d4c93f)
+++ src/sas/sascalc/fit/MultiplicationModel.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -109,5 +109,5 @@
         """
         ##set dispersion only from p_model
-        for name , value in self.p_model.dispersion.iteritems():
+        for name , value in self.p_model.dispersion.items():
             self.dispersion[name] = value
 
@@ -135,9 +135,9 @@
         """
 
-        for name , value in self.p_model.params.iteritems():
+        for name , value in self.p_model.params.items():
             if not name in self.params.keys() and name not in self.excluded_params:
                 self.params[name] = value
 
-        for name , value in self.s_model.params.iteritems():
+        for name , value in self.s_model.params.items():
             #Remove the radius_effective from the (P*S) model parameters.
             if not name in self.params.keys() and name not in self.excluded_params:
@@ -155,9 +155,9 @@
         this model's details
         """
-        for name, detail in self.p_model.details.iteritems():
+        for name, detail in self.p_model.details.items():
             if name not in self.excluded_params:
                 self.details[name] = detail
 
-        for name , detail in self.s_model.details.iteritems():
+        for name , detail in self.s_model.details.items():
             if not name in self.details.keys() or name not in self.exluded_params:
                 self.details[name] = detail
@@ -245,5 +245,5 @@
                     return
 
-        raise ValueError, "Model does not contain parameter %s" % name
+        raise ValueError("Model does not contain parameter %s" % name)
 
 
Index: src/sas/sascalc/fit/expression.py
===================================================================
--- src/sas/sascalc/fit/expression.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sascalc/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 ValueError("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/fit/pagestate.py
===================================================================
--- src/sas/sascalc/fit/pagestate.py	(revision 277257f6caa3c7a18ad588f88501a89a34aa36e4)
+++ src/sas/sascalc/fit/pagestate.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -313,14 +313,14 @@
 
         if len(self.disp_obj_dict) > 0:
-            for k, v in self.disp_obj_dict.iteritems():
+            for k, v in self.disp_obj_dict.items():
                 obj.disp_obj_dict[k] = v
         if len(self.disp_cb_dict) > 0:
-            for k, v in self.disp_cb_dict.iteritems():
+            for k, v in self.disp_cb_dict.items():
                 obj.disp_cb_dict[k] = v
         if len(self.values) > 0:
-            for k, v in self.values.iteritems():
+            for k, v in self.values.items():
                 obj.values[k] = v
         if len(self.weights) > 0:
-            for k, v in self.weights.iteritems():
+            for k, v in self.weights.items():
                 obj.weights[k] = v
         obj.enable_smearer = copy.deepcopy(self.enable_smearer)
@@ -347,5 +347,5 @@
         obj.version = copy.deepcopy(self.version)
 
-        for name, state in self.saved_states.iteritems():
+        for name, state in self.saved_states.items():
             copy_name = copy.deepcopy(name)
             copy_state = state.clone()
@@ -430,5 +430,5 @@
         """
         p_map = []
-        for name, info in params.iteritems():
+        for name, info in params.items():
             if ".fittable" in name or ".std" in name or ".upper" in name or \
                             ".lower" in name or ".units" in name:
@@ -475,5 +475,5 @@
             formfactor, str_params = convert.convert_model(
                 self.formfactorcombobox, str_pars, False, self.version)
-            for key, value in str_params.iteritems():
+            for key, value in str_params.items():
                 params[key] = value
 
@@ -835,5 +835,5 @@
             element = newdoc.createElement(item[0])
             value_list = getattr(self, item[1])
-            for key, value in value_list.iteritems():
+            for key, value in value_list.items():
                 sub_element = newdoc.createElement(key)
                 sub_element.setAttribute('name', str(key))
@@ -848,5 +848,5 @@
             element = newdoc.createElement(tagname)
             value_list = getattr(self, varname)
-            for key, value in value_list.iteritems():
+            for key, value in value_list.items():
                 sub_element = newdoc.createElement(key)
                 sub_element.setAttribute('name', str(key))
@@ -950,5 +950,5 @@
             msg = "PageState no longer supports non-CanSAS"
             msg += " format for fitting files"
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
         if node.get('version'):
@@ -1241,5 +1241,5 @@
             else:
                 self.call_back(format=ext)
-                raise RuntimeError, "%s is not a file" % path
+                raise RuntimeError("%s is not a file" % path)
 
             # Return output consistent with the loader's api
Index: src/sas/sascalc/fit/pluginmodel.py
===================================================================
--- src/sas/sascalc/fit/pluginmodel.py	(revision 5213d22cc2537cc6875bff5b448ef1c8caadfcd8)
+++ src/sas/sascalc/fit/pluginmodel.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -35,5 +35,5 @@
             return self.function(x_val)*self.function(y_val)
         elif x.__class__.__name__ == 'tuple':
-            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
+            raise ValueError("Tuples are not allowed as input to BaseComponent models")
         else:
             return self.function(x)
@@ -52,5 +52,5 @@
             return self.function(x[0])*self.function(x[1])
         elif x.__class__.__name__ == 'tuple':
-            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
+            raise ValueError("Tuples are not allowed as input to BaseComponent models")
         else:
             return self.function(x)
