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/storage.py

    r2937 r2945  
    2323# 
    2424 
     25import os 
     26import imp 
    2527from mx import DateTime 
    2628 
     
    750752    backend = backendinfo["storagebackend"] 
    751753    try : 
    752         exec "from pykota.storages import %s as storagebackend" % backend.lower() 
     754        storagebackend = imp.load_source("storagebackend",  
     755                                         os.path.join(os.path.dirname(__file__), 
     756                                                      "storages", 
     757                                                      "%s.py" % backend.lower())) 
    753758    except ImportError : 
    754759        raise PyKotaStorageError, _("Unsupported quota storage backend %s") % backend