Index: src/sas/sasgui/perspectives/fitting/fitpage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitpage.py	(revision 3bd677bda9477bbd07235d9fba448f09ae1b3932)
+++ src/sas/sasgui/perspectives/fitting/fitpage.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -281,5 +281,5 @@
 
         # Fit button
-        self.btFit = wx.Button(self, self._ids.next(), 'Fit')
+        self.btFit = wx.Button(self, next(self._ids), 'Fit')
         self.default_bt_colour = self.btFit.GetDefaultAttributes()
         self.btFit.Bind(wx.EVT_BUTTON, self._onFit, id=self.btFit.GetId())
@@ -377,5 +377,5 @@
 
         # Update and Draw button
-        self.draw_button = wx.Button(self, self._ids.next(), 'Compute')
+        self.draw_button = wx.Button(self, next(self._ids), 'Compute')
         self.draw_button.Bind(wx.EVT_BUTTON,
                               self._onDraw, id=self.draw_button.GetId())
@@ -532,5 +532,5 @@
         self.qmin.Bind(wx.EVT_TEXT, self.on_qrange_text)
         self.qmax.Bind(wx.EVT_TEXT, self.on_qrange_text)
-        wx_id = self._ids.next()
+        wx_id = next(self._ids)
         self.reset_qrange = wx.Button(self, wx_id, 'Reset')
 
@@ -540,5 +540,5 @@
         sizer = wx.GridSizer(5, 5, 2, 6)
 
-        self.btEditMask = wx.Button(self, self._ids.next(), 'Editor')
+        self.btEditMask = wx.Button(self, next(self._ids), 'Editor')
         self.btEditMask.Bind(wx.EVT_BUTTON, self._onMask,
                              id=self.btEditMask.GetId())
@@ -660,5 +660,5 @@
         self.text_disp_min.Show(True)
 
-        for item in self.model.dispersion.keys():
+        for item in list(self.model.dispersion.keys()):
             if not self.magnetic_on:
                 if item in self.model.magnetic_params:
@@ -675,5 +675,5 @@
 
                 iy += 1
-                for p in self.model.dispersion[item].keys():
+                for p in list(self.model.dispersion[item].keys()):
 
                     if p == "width":
@@ -765,5 +765,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)
@@ -779,5 +779,5 @@
                           wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         first_orient = True
-        for item in self.model.dispersion.keys():
+        for item in list(self.model.dispersion.keys()):
             if not self.magnetic_on:
                 if item in self.model.magnetic_params:
@@ -795,5 +795,5 @@
 
                 iy += 1
-                for p in self.model.dispersion[item].keys():
+                for p in list(self.model.dispersion[item].keys()):
 
                     if p == "width":
@@ -929,5 +929,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)
@@ -1370,5 +1370,5 @@
             except:
                 tcrtl.SetBackgroundColour("pink")
-                msg = "Model Error:wrong value entered : %s" % sys.exc_value
+                msg = "Model Error:wrong value entered : %s" % sys.exc_info()[1]
                 wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 return
@@ -1482,10 +1482,10 @@
                 else:
                     tcrtl.SetBackgroundColour("pink")
-                    msg = "Model Error:wrong value entered : %s" % sys.exc_value
+                    msg = "Model Error:wrong value entered : %s" % sys.exc_info()[1]
                     wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                     return
             except:
                 tcrtl.SetBackgroundColour("pink")
-                msg = "Model Error:wrong value entered : %s" % sys.exc_value
+                msg = "Model Error:wrong value entered : %s" % sys.exc_info()[1]
                 wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 return
@@ -1733,5 +1733,5 @@
         ind = 0
         while(ind < len(list)):
-            for key, val in list.items():
+            for key, val in list(list.items()):
                 if val == ind:
                     fun_box.Append(key, val)
@@ -1865,5 +1865,5 @@
                     wx.PostEvent(self._manager.parent, StatusEvent(status=msg,
                                                info="error"))
-                    raise ValueError, msg
+                    raise ValueError(msg)
 
             else:
@@ -1877,5 +1877,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)
@@ -2118,5 +2118,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
@@ -2193,5 +2193,5 @@
                 i += 1
             else:
-                raise ValueError, "onsetValues: Invalid parameters..."
+                raise ValueError("onsetValues: Invalid parameters...")
         # Show error title when any errors displayed
         if has_error:
@@ -2951,6 +2951,6 @@
 
         # type can be either Guassian or Array
-        if len(self.model.dispersion.values()) > 0:
-            type = self.model.dispersion.values()[0]["type"]
+        if len(list(self.model.dispersion.values())) > 0:
+            type = list(self.model.dispersion.values())[0]["type"]
         else:
             type = "Gaussian"
