Index: src/sas/sascalc/fit/BumpsFitting.py
===================================================================
--- src/sas/sascalc/fit/BumpsFitting.py	(revision 9a5097cd1c76689d1f997b85ba43d12a95d8f243)
+++ src/sas/sascalc/fit/BumpsFitting.py	(revision 1386b2f74db29d0e69270a9a6bf68187b52db864)
@@ -15,5 +15,5 @@
     def get_fitter():
         return FIT_CONFIG.selected_fitter, FIT_CONFIG.selected_values
-except:
+except ImportError:
     # CRUFT: Bumps changed its handling of fit options around 0.7.5.6
     # Default bumps to use the Levenberg-Marquardt optimizer
@@ -56,5 +56,5 @@
         header = "=== Steps: %s  chisq: %s  ETA: %s\n"%(step, chisq, time)
         parameters = ["%15s: %-10.3g%s"%(k,v,("\n" if i%3==2 else " | "))
-                      for i,(k,v) in enumerate(zip(pars,history.point[0]))]
+                      for i, (k, v) in enumerate(zip(pars, history.point[0]))]
         self.msg = "".join([header]+parameters)
 
@@ -77,5 +77,5 @@
         self.handler.set_result(Progress(history, self.max_step, self.pars, self.dof))
         self.handler.progress(history.step[0], self.max_step)
-        if len(history.step)>1 and history.step[1] > history.step[0]:
+        if len(history.step) > 1 and history.step[1] > history.step[0]:
             self.handler.improvement()
         self.handler.update_fit()
@@ -97,9 +97,9 @@
         try:
             p = history.population_values[0]
-            n,p = len(p), np.sort(p)
-            QI,Qmid, = int(0.2*n),int(0.5*n)
-            self.convergence.append((best, p[0],p[QI],p[Qmid],p[-1-QI],p[-1]))
-        except:
-            self.convergence.append((best, best,best,best,best,best))
+            n, p = len(p), np.sort(p)
+            QI, Qmid = int(0.2*n), int(0.5*n)
+            self.convergence.append((best, p[0], p[QI], p[Qmid], p[-1-QI], p[-1]))
+        except Exception:
+            self.convergence.append((best, best, best, best, best, best))
 
 
@@ -131,5 +131,5 @@
 
     def _reset_pars(self, names, values):
-        for k,v in zip(names, values):
+        for k, v in zip(names, values):
             self._pars[k].value = v
 
@@ -137,7 +137,7 @@
         self._pars = {}
         for k in self.model.getParamList():
-            name = ".".join((self.name,k))
+            name = ".".join((self.name, k))
             value = self.model.getParam(k)
-            bounds = self.model.details.get(k,["",None,None])[1:3]
+            bounds = self.model.details.get(k, ["", None, None])[1:3]
             self._pars[k] = parameter.Parameter(value=value, bounds=bounds,
                                                 fixed=True, name=name)
@@ -145,10 +145,14 @@
 
     def _init_pars(self, kw):
-        for k,v in kw.items():
+        for k, v in kw.items():
             # dispersion parameters initialized with _field instead of .field
-            if k.endswith('_width'): k = k[:-6]+'.width'
-            elif k.endswith('_npts'): k = k[:-5]+'.npts'
-            elif k.endswith('_nsigmas'): k = k[:-7]+'.nsigmas'
-            elif k.endswith('_type'): k = k[:-5]+'.type'
+            if k.endswith('_width'):
+                k = k[:-6]+'.width'
+            elif k.endswith('_npts'):
+                k = k[:-5]+'.npts'
+            elif k.endswith('_nsigmas'):
+                k = k[:-7]+'.nsigmas'
+            elif k.endswith('_type'):
+                k = k[:-5]+'.type'
             if k not in self._pars:
                 formatted_pars = ", ".join(sorted(self._pars.keys()))
@@ -159,8 +163,8 @@
             elif isinstance(v, parameter.BaseParameter):
                 self._pars[k] = v
-            elif isinstance(v, (tuple,list)):
+            elif isinstance(v, (tuple, list)):
                 low, high = v
                 self._pars[k].value = (low+high)/2
-                self._pars[k].range(low,high)
+                self._pars[k].range(low, high)
             else:
                 self._pars[k].value = v
@@ -170,5 +174,5 @@
         Flag a set of parameters as fitted parameters.
         """
-        for k,p in self._pars.items():
+        for k, p in self._pars.items():
             p.fixed = (k not in param_list or k in self.constraints)
         self.fitted_par_names = [k for k in param_list if k not in self.constraints]
@@ -182,7 +186,7 @@
 
     def update(self):
-        for k,v in self._pars.items():
+        for k, v in self._pars.items():
             #print "updating",k,v,v.value
-            self.model.setParam(k,v.value)
+            self.model.setParam(k, v.value)
         self._dirty = True
 
@@ -223,5 +227,5 @@
             symtab = dict((".".join((M.name, k)), p)
                           for M in self.models
-                          for k,p in M.parameters().items())
+                          for k, p in M.parameters().items())
             self.update = compile_constraints(symtab, exprs)
         else:
@@ -300,9 +304,9 @@
                                           np.NaN*np.ones(len(fitness.computed_pars))))
                 R.pvec = np.hstack((result['value'][fitted_index],
-                                      [p.value for p in fitness.computed_pars]))
+                                    [p.value for p in fitness.computed_pars]))
                 R.fitness = np.sum(R.residuals**2)/(fitness.numpoints() - len(fitted_index))
             else:
                 R.stderr = np.NaN*np.ones(len(param_list))
-                R.pvec = np.asarray( [p.value for p in fitness.fitted_pars+fitness.computed_pars])
+                R.pvec = np.asarray([p.value for p in fitness.fitted_pars+fitness.computed_pars])
                 R.fitness = np.NaN
             R.convergence = result['convergence']
@@ -331,5 +335,5 @@
     steps = options.get('steps', 0)
     if steps == 0:
-        pop = options.get('pop',0)*len(problem._parameters)
+        pop = options.get('pop', 0)*len(problem._parameters)
         samples = options.get('samples', 0)
         steps = (samples+pop-1)/pop if pop != 0 else samples
@@ -343,5 +347,5 @@
     fitdriver = fitters.FitDriver(fitclass, problem=problem,
                                   abort_test=abort_test, **options)
-    omp_threads = int(os.environ.get('OMP_NUM_THREADS','0'))
+    omp_threads = int(os.environ.get('OMP_NUM_THREADS', '0'))
     mapper = MPMapper if omp_threads == 1 else SerialMapper
     fitdriver.mapper = mapper.start_mapper(problem, None)
@@ -359,5 +363,5 @@
     convergence_list = options['monitors'][-1].convergence
     convergence = (2*np.asarray(convergence_list)/problem.dof
-                   if convergence_list else np.empty((0,1),'d'))
+                   if convergence_list else np.empty((0, 1), 'd'))
 
     success = best is not None
@@ -376,3 +380,2 @@
         'errors': '\n'.join(errors),
         }
-
