From 0d66a0954deee1443524c8b5d070c036aeaf4c82 Mon Sep 17 00:00:00 2001 From: ianb Date: Sun, 17 Jul 2005 22:45:53 +0000 Subject: Provide a more complete ImportError message --- paste/util/thirdparty.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'paste') diff --git a/paste/util/thirdparty.py b/paste/util/thirdparty.py index 0883372..7944ede 100644 --- a/paste/util/thirdparty.py +++ b/paste/util/thirdparty.py @@ -44,12 +44,12 @@ def add_package(package_name): """ try: exec "import %s" % package_name - except ImportError: + except ImportError, e: path = os.path.join(third_party, '%s-files' % package_name) if os.path.exists(path): sys.path.append(path) else: raise ImportError( "Cannot load the package %s; expected to find it in " - "%s. Have you run build-pkg.py?" - % (package_name, path)) + "%s. Have you run build-pkg.py? (import gave error: %s)" + % (package_name, path, e)) -- cgit v1.2.1