diff options
| author | ianb <devnull@localhost> | 2005-05-31 19:23:44 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-05-31 19:23:44 +0000 |
| commit | 2bd6b30bf837bc644279cda550928d01cf436fc7 (patch) | |
| tree | adeae09a0a68e4dbe8f90b8803e5732eae10e2c9 /paste/util | |
| parent | 6d2877dd2842689c791a3f500c31fbbe950f766f (diff) | |
| download | paste-2bd6b30bf837bc644279cda550928d01cf436fc7.tar.gz | |
Give better error message
Diffstat (limited to 'paste/util')
| -rw-r--r-- | paste/util/import_string.py | 6 |
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 |
