Index: src/sas/sascalc/dataloader/readers/__init__.py
===================================================================
--- src/sas/sascalc/dataloader/readers/__init__.py	(revision 7a5d066739473fc9f63271f90b7e77e54ede5169)
+++ src/sas/sascalc/dataloader/readers/__init__.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -1,4 +1,4 @@
 # Method to associate extensions to default readers
-from associations import read_associations
+from .associations import read_associations
 
 
Index: src/sas/sascalc/dataloader/readers/abs_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/abs_reader.py	(revision ad92c5a96ecb73ee7094bafca363a6a7a61a530d)
+++ src/sas/sascalc/dataloader/readers/abs_reader.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -31,9 +31,9 @@
     # List of allowed extensions
     ext = ['.abs']
-    
+
     def get_file_contents(self):
-        """ 
+        """
         Get the contents of the file
-        
+
         :raise RuntimeError: when the file can't be opened
         :raise ValueError: when the length of the data vectors are inconsistent
Index: src/sas/sascalc/dataloader/readers/ascii_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/ascii_reader.py	(revision f994e8b1aa05e01ca78e9e360337d188540cd1bc)
+++ src/sas/sascalc/dataloader/readers/ascii_reader.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -130,5 +130,5 @@
                 # Reset # of lines of data candidates
                 candidate_lines = 0
-        
+
         if not is_data:
             self.set_all_to_none()
Index: src/sas/sascalc/dataloader/readers/associations.py
===================================================================
--- src/sas/sascalc/dataloader/readers/associations.py	(revision ce8c7bd4870bc1b63b94231ed8f227410e8faee1)
+++ src/sas/sascalc/dataloader/readers/associations.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -40,5 +40,5 @@
     """
     # For each FileType entry, get the associated reader and extension
-    for ext, reader in settings.iteritems():
+    for ext, reader in settings.items():
         if reader is not None and ext is not None:
             # Associate the extension with a particular reader
@@ -47,9 +47,9 @@
             # and remove the extra line below.
             try:
-                exec "import %s" % reader
-                exec "loader.associate_file_type('%s', %s)" % (ext.lower(),
-                                                                reader)
-                exec "loader.associate_file_type('%s', %s)" % (ext.upper(),
-                                                                reader)
+                exec("from . import %s" % reader)
+                exec("loader.associate_file_type('%s', %s)"
+                     % (ext.lower(), reader))
+                exec("loader.associate_file_type('%s', %s)"
+                     % (ext.upper(), reader))
             except:
                 msg = "read_associations: skipping association"
Index: src/sas/sascalc/dataloader/readers/cansas_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/cansas_reader.py	(revision ae69c690bae8eb1cae0c6902dd71755dda9710f8)
+++ src/sas/sascalc/dataloader/readers/cansas_reader.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -1,20 +1,9 @@
 import logging
-import numpy as np
 import os
 import sys
 import datetime
 import inspect
-# For saving individual sections of data
-from sas.sascalc.dataloader.data_info import Data1D, Data2D, DataInfo, \
-    plottable_1D, plottable_2D
-from sas.sascalc.dataloader.data_info import Collimation, TransmissionSpectrum, \
-    Detector, Process, Aperture
-from sas.sascalc.dataloader.data_info import \
-    combine_data_info_with_plottable as combine_data
-import sas.sascalc.dataloader.readers.xml_reader as xml_reader
-from sas.sascalc.dataloader.readers.xml_reader import XMLreader
-from sas.sascalc.dataloader.readers.cansas_constants import CansasConstants, CurrentLevel
-from sas.sascalc.dataloader.loader_exceptions import FileContentsException, \
-    DefaultReaderException, DataReaderException
+
+import numpy as np
 
 # The following 2 imports *ARE* used. Do not remove either.
@@ -23,4 +12,16 @@
 
 from lxml import etree
+
+from sas.sascalc.data_util.nxsunit import Converter
+
+# For saving individual sections of data
+from ..data_info import Data1D, Data2D, DataInfo, plottable_1D, plottable_2D, \
+    Collimation, TransmissionSpectrum, Detector, Process, Aperture, \
+    combine_data_info_with_plottable as combine_data
+from ..loader_exceptions import FileContentsException, DefaultReaderException, \
+    DataReaderException
+from . import xml_reader
+from .xml_reader import XMLreader
+from .cansas_constants import CansasConstants, CurrentLevel
 
 logger = logging.getLogger(__name__)
@@ -34,8 +35,4 @@
               "as much of the data as possible.\n\n"
 HAS_CONVERTER = True
-try:
-    from sas.sascalc.data_util.nxsunit import Converter
-except ImportError:
-    HAS_CONVERTER = False
 
 CONSTANTS = CansasConstants()
@@ -163,5 +160,6 @@
                 raise fc_exc
         except Exception as e: # Convert all other exceptions to FileContentsExceptions
-            raise FileContentsException(e.message)
+            raise
+            raise FileContentsException(str(e))
 
 
@@ -632,8 +630,9 @@
                 else:
                     save_in = "current_datainfo"
-                exec "default_unit = self.{0}.{1}".format(save_in, unitname)
-                if local_unit and default_unit and local_unit.lower() != default_unit.lower() \
-                        and local_unit.lower() != "none":
-                    if HAS_CONVERTER == True:
+                exec("default_unit = self.{0}.{1}".format(save_in, unitname))
+                if (local_unit and default_unit
+                        and local_unit.lower() != default_unit.lower()
+                        and local_unit.lower() != "none"):
+                    if HAS_CONVERTER:
                         # Check local units - bad units raise KeyError
                         data_conv_q = Converter(local_unit)
@@ -654,5 +653,5 @@
                     err_msg += "expecting [{0}]".format(default_unit)
                 value_unit = local_unit
-            except:
+            except Exception:
                 err_msg = "CanSAS reader: unknown error converting "
                 err_msg += "\"{0}\" unit [{1}]"
@@ -908,7 +907,7 @@
         point = self.create_element("Idata")
         node.append(point)
-        qx = ','.join([str(datainfo.qx_data[i]) for i in xrange(len(datainfo.qx_data))])
-        qy = ','.join([str(datainfo.qy_data[i]) for i in xrange(len(datainfo.qy_data))])
-        intensity = ','.join([str(datainfo.data[i]) for i in xrange(len(datainfo.data))])
+        qx = ','.join(str(v) for v in datainfo.qx_data)
+        qy = ','.join(str(v) for v in datainfo.qy_data)
+        intensity = ','.join(str(v) for v in datainfo.data)
 
         self.write_node(point, "Qx", qx,
@@ -919,22 +918,17 @@
                         {'unit': datainfo._zunit})
         if datainfo.err_data is not None:
-            err = ','.join([str(datainfo.err_data[i]) for i in
-                            xrange(len(datainfo.err_data))])
+            err = ','.join(str(v) for v in datainfo.err_data)
             self.write_node(point, "Idev", err,
                             {'unit': datainfo._zunit})
         if datainfo.dqy_data is not None:
-            dqy = ','.join([str(datainfo.dqy_data[i]) for i in
-                            xrange(len(datainfo.dqy_data))])
+            dqy = ','.join(str(v) for v in datainfo.dqy_data)
             self.write_node(point, "Qydev", dqy,
                             {'unit': datainfo._yunit})
         if datainfo.dqx_data is not None:
-            dqx = ','.join([str(datainfo.dqx_data[i]) for i in
-                            xrange(len(datainfo.dqx_data))])
+            dqx = ','.join(str(v) for v in datainfo.dqx_data)
             self.write_node(point, "Qxdev", dqx,
                             {'unit': datainfo._xunit})
         if datainfo.mask is not None:
-            mask = ','.join(
-                ["1" if datainfo.mask[i] else "0"
-                 for i in xrange(len(datainfo.mask))])
+            mask = ','.join("1" if v else "0" for v in datainfo.mask)
             self.write_node(point, "Mask", mask)
 
@@ -1280,5 +1274,5 @@
         try:
             value = float(entry.text)
-        except:
+        except ValueError:
             value = None
 
@@ -1289,13 +1283,12 @@
             if units is not None:
                 toks = variable.split('.')
-                local_unit = None
-                exec "local_unit = storage.%s_unit" % toks[0]
+                exec("local_unit = storage.%s_unit" % toks[0])
                 if local_unit is not None and units.lower() != local_unit.lower():
                     if HAS_CONVERTER == True:
                         try:
                             conv = Converter(units)
-                            exec "storage.%s = %g" % \
-                                (variable, conv(value, units=local_unit))
-                        except:
+                            exec("storage.%s = %g" %
+-                                (variable, conv(value, units=local_unit)))
+                        except Exception:
                             _, exc_value, _ = sys.exc_info()
                             err_mess = "CanSAS reader: could not convert"
@@ -1306,5 +1299,5 @@
                                 logger.info(err_mess)
                             else:
-                                raise ValueError, err_mess
+                                raise ValueError(err_mess)
                     else:
                         err_mess = "CanSAS reader: unrecognized %s unit [%s];"\
@@ -1315,9 +1308,9 @@
                             logger.info(err_mess)
                         else:
-                            raise ValueError, err_mess
+                            raise ValueError(err_mess)
                 else:
-                    exec "storage.%s = value" % variable
+                    exec("storage.%s = value" % variable)
             else:
-                exec "storage.%s = value" % variable
+                exec("storage.%s = value" % variable)
 
     # DO NOT REMOVE - used in saving and loading panel states.
@@ -1339,5 +1332,5 @@
         entry = get_content(location, node)
         if entry is not None and entry.text is not None:
-            exec "storage.%s = entry.text.strip()" % variable
+            exec("storage.%s = entry.text.strip()" % variable)
 
 # DO NOT REMOVE Called by outside packages:
Index: src/sas/sascalc/dataloader/readers/danse_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/danse_reader.py	(revision a78a02fe90f1c962f523301685c143a27f11ba7d)
+++ src/sas/sascalc/dataloader/readers/danse_reader.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -14,10 +14,12 @@
 import math
 import os
+import logging
+
 import numpy as np
-import logging
-from sas.sascalc.dataloader.data_info import plottable_2D, DataInfo, Detector
-from sas.sascalc.dataloader.manipulations import reader2D_converter
-from sas.sascalc.dataloader.file_reader_base_class import FileReader
-from sas.sascalc.dataloader.loader_exceptions import FileContentsException, DataReaderException
+
+from ..data_info import plottable_2D, DataInfo, Detector
+from ..manipulations import reader2D_converter
+from ..file_reader_base_class import FileReader
+from ..loader_exceptions import FileContentsException, DataReaderException
 
 logger = logging.getLogger(__name__)
Index: src/sas/sascalc/dataloader/readers/sesans_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/sesans_reader.py	(revision be434489a51d7ec8b03d82a7e2d53cb8baa37c83)
+++ src/sas/sascalc/dataloader/readers/sesans_reader.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -6,9 +6,11 @@
     Jurrian Bakker
 """
+import os
+
 import numpy as np
-import os
-from sas.sascalc.dataloader.file_reader_base_class import FileReader
-from sas.sascalc.dataloader.data_info import plottable_1D, DataInfo
-from sas.sascalc.dataloader.loader_exceptions import FileContentsException, DataReaderException
+
+from ..file_reader_base_class import FileReader
+from ..data_info import plottable_1D, DataInfo
+from ..loader_exceptions import FileContentsException, DataReaderException
 
 # Check whether we have a converter available
Index: src/sas/sascalc/dataloader/readers/tiff_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/tiff_reader.py	(revision 959eb0181ad06828a748f04512f953aad5b31659)
+++ src/sas/sascalc/dataloader/readers/tiff_reader.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -2,5 +2,5 @@
 #This software was developed by the University of Tennessee as part of the
 #Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
-#project funded by the US National Science Foundation. 
+#project funded by the US National Science Foundation.
 #See the license text in license.txt
 #copyright 2008, University of Tennessee
@@ -31,9 +31,9 @@
     ## Extension
     ext = ['.tif', '.tiff']
-        
+
     def read(self, filename=None):
         """
         Open and read the data in a file
-        
+
         :param file: path of the file
         """
@@ -44,15 +44,15 @@
         except:
             msg = "tiff_reader: could not load file. Missing Image module."
-            raise RuntimeError, msg
-        
+            raise RuntimeError(msg)
+
         # Instantiate data object
         output = Data2D()
         output.filename = os.path.basename(filename)
-            
+
         # Read in the image
         try:
             im = Image.open(filename)
         except:
-            raise  RuntimeError, "cannot open %s"%(filename)
+            raise  RuntimeError("cannot open %s"%(filename))
         data = im.getdata()
 
@@ -61,5 +61,5 @@
         output.err_data = np.zeros([im.size[0], im.size[1]])
         output.mask = np.ones([im.size[0], im.size[1]], dtype=bool)
-        
+
         # Initialize
         x_vals = []
@@ -69,5 +69,5 @@
         for i_x in range(im.size[0]):
             x_vals.append(i_x)
-            
+
         itot = 0
         for i_y in range(im.size[1]):
@@ -80,5 +80,5 @@
                 logger.error("tiff_reader: had to skip a non-float point")
                 continue
-            
+
             # Get bin number
             if math.fmod(itot, im.size[0]) == 0:
@@ -87,9 +87,9 @@
             else:
                 i_x += 1
-                
+
             output.data[im.size[1] - 1 - i_y][i_x] = value
-            
+
             itot += 1
-                
+
         output.xbins = im.size[0]
         output.ybins = im.size[1]
@@ -102,5 +102,5 @@
         output.ymin = 0
         output.ymax = im.size[0] - 1
-        
+
         # Store loading process information
         output.meta_data['loader'] = self.type_name
Index: src/sas/sascalc/dataloader/readers/xml_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/xml_reader.py	(revision fafe52a82bebe8d8a20bfb820388c964aa3c4b7b)
+++ src/sas/sascalc/dataloader/readers/xml_reader.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
@@ -16,6 +16,8 @@
 
 import logging
+
 from lxml import etree
 from lxml.builder import E
+
 from sas.sascalc.dataloader.file_reader_base_class import FileReader
 
@@ -151,5 +153,5 @@
         Converts an etree element into a string
         """
-        return etree.tostring(elem, pretty_print=pretty_print, \
+        return etree.tostring(elem, pretty_print=pretty_print,
                               encoding=encoding)
 
