src/reportlab/lib/utils.py
changeset 3668 d8a42e00c079
parent 3634 30efff664458
child 3687 1fead6079288
--- a/src/reportlab/lib/utils.py	Sun Mar 24 07:42:19 2013 +0000
+++ b/src/reportlab/lib/utils.py	Wed Mar 27 13:19:33 2013 +0000
@@ -291,11 +291,16 @@
         return m
     except ImportError:
         sys.path = opath
-        msg = "recursiveimport(%s,baseDir=%s) failed" % (modulename,baseDir)
+        msg = "Could not import '%s'" % modulename
         if baseDir:
-            msg = msg + " under paths '%s'" % repr(path)
+            msg = msg + " under %s" % baseDir
         raise ImportError, msg
 
+    except Exception, e:
+        msg = "Exception raised while importing '%s': %s" % (modulename, e.message)
+        raise ImportError, msg
+        
+
 def recursiveGetAttr(obj, name):
     "Can call down into e.g. object1.object2[4].attr"
     return eval(name, obj.__dict__)