summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-05-31 19:23:44 +0000
committerianb <devnull@localhost>2005-05-31 19:23:44 +0000
commit2bd6b30bf837bc644279cda550928d01cf436fc7 (patch)
treeadeae09a0a68e4dbe8f90b8803e5732eae10e2c9
parent6d2877dd2842689c791a3f500c31fbbe950f766f (diff)
downloadpaste-2bd6b30bf837bc644279cda550928d01cf436fc7.tar.gz
Give better error message
-rw-r--r--paste/util/import_string.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/paste/util/import_string.py b/paste/util/import_string.py
index af32b24..d3e5771 100644
--- a/paste/util/import_string.py
+++ b/paste/util/import_string.py
@@ -32,7 +32,11 @@ def simple_import(s):
break
obj = module
while parts:
- obj = getattr(module, parts[0])
+ try:
+ obj = getattr(module, parts[0])
+ except AttributeError:
+ raise ImportError(
+ "Cannot find %s in module %r" % (parts[0], module))
parts = parts[1:]
return obj