Index: src/sas/sasgui/perspectives/fitting/fitting.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitting.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sasgui/perspectives/fitting/fitting.py	(revision fa81e94af983227efded2314c2c544f98e2c56ba)
@@ -11,5 +11,5 @@
 #copyright 2009, University of Tennessee
 ################################################################################
-from __future__ import print_function
+
 
 import re
@@ -142,5 +142,5 @@
         Given an ID create a fitproblem container
         """
-        if page_id in self.page_finder.iterkeys():
+        if page_id in iter(self.page_finder.keys()):
             del self.page_finder[page_id]
 
@@ -335,5 +335,5 @@
             if temp:
                 # Set the new plugin model list for all fit pages
-                for uid, page in self.fit_panel.opened_pages.iteritems():
+                for uid, page in self.fit_panel.opened_pages.items():
                     if hasattr(page, "formfactorbox"):
                         page.model_list_box = temp
@@ -350,5 +350,5 @@
                                 page.formfactorbox.SetLabel(current_val)
         except:
-            logger.error("update_custom_combo: %s", sys.exc_value)
+            logger.error("update_custom_combo: %s", sys.exc_info()[1])
 
     def set_edit_menu(self, owner):
@@ -556,5 +556,5 @@
         else:
             if len(data_list) > MAX_NBR_DATA:
-                from fitting_widgets import DataDialog
+                from .fitting_widgets import DataDialog
                 dlg = DataDialog(data_list=data_list, nb_data=MAX_NBR_DATA)
                 if dlg.ShowModal() == wx.ID_OK:
@@ -576,5 +576,5 @@
                         self.add_fit_page(data=[data])
             except:
-                msg = "Fitting set_data: " + str(sys.exc_value)
+                msg = "Fitting set_data: " + str(sys.exc_info()[1])
                 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error"))
 
@@ -590,5 +590,5 @@
                 msg = "Fitting: cannot deal with the theory received"
                 evt = StatusEvent(status=msg, info="error")
-                logger.error("set_theory " + msg + "\n" + str(sys.exc_value))
+                logger.error("set_theory " + msg + "\n" + str(sys.exc_info()[1]))
                 wx.PostEvent(self.parent, evt)
 
@@ -602,5 +602,5 @@
         """
         from pagestate import PageState
-        from simfitpage import SimFitPageState
+        from .simfitpage import SimFitPageState
         if isinstance(state, PageState):
             state = state.clone()
@@ -713,5 +713,5 @@
         if fid is None:
             return
-        if uid in self.page_finder.keys():
+        if uid in list(self.page_finder.keys()):
             self.page_finder[uid].set_weight(flag=flag, is2d=is2d)
 
@@ -726,5 +726,5 @@
         :param qmax: maximum  value of the fit range
         """
-        if uid in self.page_finder.keys():
+        if uid in list(self.page_finder.keys()):
             self.page_finder[uid].set_range(qmin=qmin, qmax=qmax, fid=fid)
 
@@ -737,5 +737,5 @@
         :param uid: the id related to a page contaning fitting information
         """
-        if uid in self.page_finder.keys():
+        if uid in list(self.page_finder.keys()):
             self.page_finder[uid].schedule_tofit(value)
 
@@ -756,5 +756,5 @@
         """
         sim_page_id = self.sim_page.uid
-        for uid, value in self.page_finder.iteritems():
+        for uid, value in self.page_finder.items():
             if uid != sim_page_id and uid != self.batch_page.uid:
                 model_list = value.get_model()
@@ -821,5 +821,5 @@
         Stop the fit
         """
-        if uid in self.fit_thread_list.keys():
+        if uid in list(self.fit_thread_list.keys()):
             calc_fit = self.fit_thread_list[uid]
             if calc_fit is not  None and calc_fit.isrunning():
@@ -833,7 +833,7 @@
         batch_flag = self.batch_page is not None and uid == self.batch_page.uid
         if sim_flag or batch_flag:
-            for uid, value in self.page_finder.iteritems():
+            for uid, value in self.page_finder.items():
                 if value.get_scheduled() == 1:
-                    if uid in self.fit_panel.opened_pages.keys():
+                    if uid in list(self.fit_panel.opened_pages.keys()):
                         panel = self.fit_panel.opened_pages[uid]
                         panel._on_fit_complete()
@@ -852,5 +852,5 @@
         :param draw: Determine if the theory needs to be plot
         """
-        if uid not in self.page_finder.keys():
+        if uid not in list(self.page_finder.keys()):
             return
         self.page_finder[uid].enable_smearing(flag=enable_smearer)
@@ -964,5 +964,5 @@
         list_page_id = []
         fit_id = 0
-        for page_id, page_info in self.page_finder.iteritems():
+        for page_id, page_info in self.page_finder.items():
             # For simulfit (uid give with None), do for-loop
             # if uid is specified (singlefit), do it only on the page.
@@ -991,5 +991,5 @@
 
                     pars = [str(element[1]) for element in page.param_toFit]
-                    fitproblem_list = page_info.values()
+                    fitproblem_list = list(page_info.values())
                     for fitproblem in  fitproblem_list:
                         if sim_fitter is None:
@@ -1013,5 +1013,5 @@
             except:
                 raise
-                msg = "Fitting error: %s" % str(sys.exc_value)
+                msg = "Fitting error: %s" % str(sys.exc_info()[1])
                 evt = StatusEvent(status=msg, info="error", type="stop")
                 wx.PostEvent(self.parent, evt)
@@ -1070,5 +1070,5 @@
         :param fid: the id of the fitproblem(data, model, range,etc)
         """
-        if uid not in self.page_finder.keys():
+        if uid not in list(self.page_finder.keys()):
             return
         fitproblemList = self.page_finder[uid].get_fit_problem(fid)
@@ -1116,5 +1116,5 @@
                 wx.PostEvent(self.parent, evt)
         except:
-            msg = "Creating Fit page: %s" % sys.exc_value
+            msg = "Creating Fit page: %s" % sys.exc_info()[1]
             wx.PostEvent(self.parent, StatusEvent(status=msg, info="error"))
 
@@ -1196,9 +1196,9 @@
         # case that uid is not specified
         if uid is None:
-            for page_id in self.page_finder.keys():
+            for page_id in list(self.page_finder.keys()):
                 self.page_finder[page_id].schedule_tofit(value)
         # when uid is given
         else:
-            if uid in self.page_finder.keys():
+            if uid in list(self.page_finder.keys()):
                 self.page_finder[uid].schedule_tofit(value)
 
@@ -1234,5 +1234,5 @@
         panel = self.plot_panel
         if panel is None:
-            raise ValueError, "Fitting:_onSelect: NonType panel"
+            raise ValueError("Fitting:_onSelect: NonType panel")
         Plugin.on_perspective(self, event=event)
         self.select_data(panel)
@@ -1267,5 +1267,5 @@
         """
         uid = page_id[0]
-        if uid in self.fit_thread_list.keys():
+        if uid in list(self.fit_thread_list.keys()):
             del self.fit_thread_list[uid]
 
@@ -1293,16 +1293,16 @@
                 #get all fittable parameters of the current model
                 for param in  model.getParamList():
-                    if param  not in batch_outputs.keys():
+                    if param  not in list(batch_outputs.keys()):
                         batch_outputs[param] = []
                 for param in model.getDispParamList():
                     if not model.is_fittable(param) and \
-                        param in batch_outputs.keys():
+                        param in list(batch_outputs.keys()):
                         del batch_outputs[param]
                 # Add fitted parameters and their error
                 for param in res.param_list:
-                    if param not in batch_outputs.keys():
+                    if param not in list(batch_outputs.keys()):
                         batch_outputs[param] = []
                     err_param = "error on %s" % str(param)
-                    if err_param not in batch_inputs.keys():
+                    if err_param not in list(batch_inputs.keys()):
                         batch_inputs[err_param] = []
         msg = ""
@@ -1389,5 +1389,5 @@
                 #model
                 EMPTY = "-"
-                for key in batch_outputs.keys():
+                for key in list(batch_outputs.keys()):
                     if key not in param_list and key not in ["Chi2", "Data"]:
                         batch_outputs[key].append(EMPTY)
@@ -1432,5 +1432,5 @@
         tbatch_outputs = {}
         shownkeystr = cpage.get_copy_params()
-        for key in batch_outputs.keys():
+        for key in list(batch_outputs.keys()):
             if key in ["Chi2", "Data"] or shownkeystr.count(key) > 0:
                 tbatch_outputs[key] = batch_outputs[key]
@@ -1452,5 +1452,5 @@
         model = fitproblem.get_model()
         #fill batch result information
-        if "Data" not in batch_outputs.keys():
+        if "Data" not in list(batch_outputs.keys()):
             batch_outputs["Data"] = []
         from sas.sasgui.guiframe.data_processor import BatchCell
@@ -1482,6 +1482,6 @@
         cell.object = [data, theory_data]
         batch_outputs["Data"].append(cell)
-        for key, value in data.meta_data.iteritems():
-            if key not in batch_inputs.keys():
+        for key, value in data.meta_data.items():
+            if key not in list(batch_inputs.keys()):
                 batch_inputs[key] = []
             #if key.lower().strip() != "loader":
@@ -1489,5 +1489,5 @@
         param = "temperature"
         if hasattr(data.sample, param):
-            if param not in  batch_inputs.keys():
+            if param not in  list(batch_inputs.keys()):
                 batch_inputs[param] = []
             batch_inputs[param].append(data.sample.temperature)
@@ -1562,5 +1562,5 @@
         except:
             msg = ("Fit completed but the following error occurred: %s"
-                   % sys.exc_value)
+                   % sys.exc_info()[1])
             #import traceback; msg = "\n".join((traceback.format_exc(), msg))
             evt = StatusEvent(status=msg, info="warning", type="stop")
@@ -1650,5 +1650,5 @@
         if model is None:
             return
-        if uid not in self.page_finder.keys():
+        if uid not in list(self.page_finder.keys()):
             return
         # save the name containing the data name with the appropriate model
@@ -1903,5 +1903,5 @@
             return None
         try:
-            from model_thread import Calc2D
+            from .model_thread import Calc2D
             ## If a thread is already started, stop it
             if (self.calc_2D is not None) and self.calc_2D.isrunning():
@@ -1950,5 +1950,5 @@
             return
         try:
-            from model_thread import Calc1D
+            from .model_thread import Calc1D
             ## If a thread is already started, stop it
             if (self.calc_1D is not None) and self.calc_1D.isrunning():
@@ -1989,5 +1989,5 @@
         except:
             msg = " Error occurred when drawing %s Model 1D: " % model.name
-            msg += " %s" % sys.exc_value
+            msg += " %s" % sys.exc_info()[1]
             wx.PostEvent(self.parent, StatusEvent(status=msg))
 
