Show
Ignore:
Timestamp:
06/16/06 16:25:49 (18 years ago)
Author:
jerome
Message:

Replaced the 'exec' statements with the use of the standard 'imp' module.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/reporter.py

    r2879 r2945  
    2323# 
    2424 
     25import os 
     26import imp 
    2527from mx import DateTime 
    2628 
     
    142144    """Returns a reporter instance of the proper reporter.""" 
    143145    try : 
    144         exec "from pykota.reporters import %s as reporterbackend" % reporttype.lower() 
     146        reporterbackend = imp.load_source("reporterbackend",  
     147                                           os.path.join(os.path.dirname(__file__), 
     148                                                        "reporters", 
     149                                                        "%s.py" % reporttype.lower())) 
    145150    except ImportError : 
    146151        raise PyKotaReporterError, _("Unsupported reporter backend %s") % reporttype