Changeset 2102


Ignore:
Timestamp:
11/03/10 15:22:52 (3 years ago)
Author:
jdsiiro
Message:

If we catch an exception while loading a module, include the message
from the caught exception as part of the "Failed to load python module"
exception we throw.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyutilib.misc/trunk/pyutilib/misc/import_file.py

    r2101 r2102  
    7777            module = imp.load_source( name, filename ) 
    7878            #print "Loaded module '%s'" % ( filename ) 
     79        except Exception, e: 
     80            raise RuntimeError, "Failed to load python module="+str(filename)+\ 
     81                  ":\n\t" + str(e) 
    7982        except: 
    80            raise RuntimeError, "Failed to load python module="+str(filename) 
     83            raise RuntimeError, "Failed to load python module="+str(filename) 
    8184        sys.path.remove( dirname ) 
    8285    # 
Note: See TracChangeset for help on using the changeset viewer.