Index: src/sas/sasgui/perspectives/fitting/fitpage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitpage.py	(revision ba1c14560ba5f607c084c317e9b98cd8acfbfaa7)
+++ src/sas/sasgui/perspectives/fitting/fitpage.py	(revision 5251ec6db8aae214addfa0a5a1da16820994958b)
@@ -766,5 +766,5 @@
                 disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1),
                                        style=wx.CB_READONLY, name='%s' % name1)
-                for key, value in POLYDISPERSITY_MODELS.iteritems():
+                for key, value in POLYDISPERSITY_MODELS.items():
                     name_disp = str(key)
                     disp_box.Append(name_disp, value)
@@ -930,5 +930,5 @@
                 disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1),
                                 style=wx.CB_READONLY, name='%s' % name1)
-                for key, value in POLYDISPERSITY_MODELS.iteritems():
+                for key, value in POLYDISPERSITY_MODELS.items():
                     name_disp = str(key)
                     disp_box.Append(name_disp, value)
@@ -1372,7 +1372,7 @@
                 self._check_value_enter(self.fittable_param)
                 self._check_value_enter(self.parameters)
-            except:
+            except Exception as exc:
                 tcrtl.SetBackgroundColour("pink")
-                msg = "Model Error:wrong value entered : %s" % sys.exc_value
+                msg = "Model Error:wrong value entered : %s" % exc
                 wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 return
@@ -1486,10 +1486,11 @@
                 else:
                     tcrtl.SetBackgroundColour("pink")
-                    msg = "Model Error:wrong value entered : %s" % sys.exc_value
+                    _, exc, _ = sys.exc_info()
+                    msg = "Model Error:wrong value entered : %s" % exc
                     wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                     return
-            except:
+            except Exception as exc:
                 tcrtl.SetBackgroundColour("pink")
-                msg = "Model Error:wrong value entered : %s" % sys.exc_value
+                msg = "Model Error:wrong value entered : %s" % exc
                 wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 return
@@ -1859,5 +1860,5 @@
                     wx.PostEvent(self._manager.parent, StatusEvent(status=msg,
                                                info="error"))
-                    raise ValueError, msg
+                    raise ValueError(msg)
 
             else:
@@ -1871,5 +1872,5 @@
                     wx.PostEvent(self._manager.parent, StatusEvent(status=msg,
                                                info="error"))
-                    raise ValueError, msg
+                    raise ValueError(msg)
                 # Maximum value of data
                 qmax = math.sqrt(x * x + y * y)
@@ -2113,5 +2114,5 @@
         self._on_fit_complete()
         if out is None or not np.isfinite(chisqr):
-            raise ValueError, "Fit error occured..."
+            raise ValueError("Fit error occured...")
 
         is_modified = False
@@ -2188,5 +2189,5 @@
                 i += 1
             else:
-                raise ValueError, "onsetValues: Invalid parameters..."
+                raise ValueError("onsetValues: Invalid parameters...")
         # Show error title when any errors displayed
         if has_error:
@@ -2947,7 +2948,7 @@
         # type can be either Guassian or Array
         if len(self.model.dispersion.values()) > 0:
-            type = self.model.dispersion.values()[0]["type"]
+            dist_type = list(self.model.dispersion.values())[0]["type"]
         else:
-            type = "Gaussian"
+            dist_type = "Gaussian"
 
         iy += 1
@@ -3008,5 +3009,5 @@
 
         # For Gaussian only
-        if type.lower() != "array":
+        if dist_type.lower() != "array":
             for item in self.model.orientation_params:
                 if not self.magnetic_on:
