1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 20:51:30 +00:00

Also handle subclasses of OSError when running an executable.

We checked for OSError so that we could give a useful custom error
message on ENOENT. But on Windows, it is a WindowsError, which is a
subclass of OSError.
This commit is contained in:
david
2012-06-19 16:43:42 +00:00
parent 7f5d53184c
commit 373d00fcee

View File

@@ -480,7 +480,7 @@ or type the nmap command you would like to execute."),
command_execution.run_scan()
except Exception, e:
text = str(e)
if type(e) == OSError:
if isinstance(e, OSError):
# Handle ENOENT specially.
if e.errno == errno.ENOENT:
# nmap_command_path comes from zenmapCore.NmapCommand.