From 402960a2a7f64eb81e6f2742a81ca46bc6c25045 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 18 May 2012 16:41:37 +0000 Subject: [PATCH] Friendlier error message when Zenmap modules can't be imported. --- zenmap/zenmap | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/zenmap/zenmap b/zenmap/zenmap index ae9894ee2..fca2ce448 100755 --- a/zenmap/zenmap +++ b/zenmap/zenmap @@ -140,7 +140,18 @@ INSTALL_LIB = None if INSTALL_LIB is not None and is_secure_dir(INSTALL_LIB): sys.path.append(INSTALL_LIB) -import zenmapGUI.App +try: + import zenmapGUI.App +except ImportError, e: + print >> sys.stderr, """\ +Could not import the zenmapGUI.App module: %s. +I checked in these directories:""" % repr(e.message) + for dir in sys.path: + print >> sys.stderr, " %s" % dir + print >> sys.stderr, """\ +If you installed Zenmap in another directory, you may have to add the +modules directory to the PYTHONPATH environment variable.""" + sys.exit(1) if __name__ == '__main__': try: