1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 02:19:04 +00:00

Friendlier error message when Zenmap modules can't be imported.

This commit is contained in:
david
2012-05-18 16:41:37 +00:00
parent 0283d41798
commit 402960a2a7

View File

@@ -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: