diff options
| author | Monty Taylor <mordred@inaugust.com> | 2012-08-17 09:48:37 -0400 |
|---|---|---|
| committer | Monty Taylor <mordred@inaugust.com> | 2012-08-17 09:54:17 -0400 |
| commit | cd1424a5543ce01b3bd13887f2d1e818b8c296d3 (patch) | |
| tree | d9dfdf8d90cde89e14874334360f8c9adeb6446d /openstack | |
| parent | 6a22ea45edc0f0263731944f2ad0ffe15c8a9457 (diff) | |
| download | oslo-cd1424a5543ce01b3bd13887f2d1e818b8c296d3.tar.gz oslo-cd1424a5543ce01b3bd13887f2d1e818b8c296d3.tar.xz oslo-cd1424a5543ce01b3bd13887f2d1e818b8c296d3.zip | |
Don't trap then re-raise ImportError.
When we catch ImportError, print a message, and then raise a new ImportError,
we lose sane ability to read the traceback, and we gain nothing. Raising a new
ImportError on Attribute or Value error is helpful, given the context in which
we are working.
Change-Id: I52f61405e63535bcc745c9d350aa0dfbae36a8ac
Diffstat (limited to 'openstack')
| -rw-r--r-- | openstack/common/importutils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openstack/common/importutils.py b/openstack/common/importutils.py index 2fbb029..f45372b 100644 --- a/openstack/common/importutils.py +++ b/openstack/common/importutils.py @@ -29,7 +29,7 @@ def import_class(import_str): try: __import__(mod_str) return getattr(sys.modules[mod_str], class_str) - except (ImportError, ValueError, AttributeError), exc: + except (ValueError, AttributeError), exc: raise ImportError('Class %s cannot be found (%s)' % (class_str, traceback.format_exception(*sys.exc_info()))) |
