Index: src/sas/sasgui/perspectives/fitting/fitpage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitpage.py	(revision 31c1baeb0c78cbeb620328f57fe0203e98d931b5)
+++ src/sas/sasgui/perspectives/fitting/fitpage.py	(revision 31c1baeb0c78cbeb620328f57fe0203e98d931b5)
@@ -780,5 +780,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)
@@ -938,5 +938,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)
@@ -1378,7 +1378,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
@@ -1492,10 +1492,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
@@ -1902,5 +1903,5 @@
                     wx.PostEvent(self._manager.parent, StatusEvent(status=msg,
                                                info="error"))
-                    raise ValueError, msg
+                    raise ValueError(msg)
 
             else:
@@ -1914,5 +1915,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)
@@ -2154,5 +2155,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
@@ -2229,5 +2230,5 @@
                 i += 1
             else:
-                raise ValueError, "onsetValues: Invalid parameters..."
+                raise ValueError("onsetValues: Invalid parameters...")
         # Show error title when any errors displayed
         if has_error:
@@ -2985,7 +2986,7 @@
         # type can be either Guassian or Array
         if len(self.model.dispersion.values()) > 0:
-            type = self.model.dispersion.values()[0]["type"]
-        else:
-            type = "Gaussian"
+            dist_type = list(self.model.dispersion.values())[0]["type"]
+        else:
+            dist_type = "Gaussian"
 
         iy += 1
@@ -3045,5 +3046,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:
