From 373d00fcee37a50e48fce6eb952664eb8285aa4d Mon Sep 17 00:00:00 2001 From: david Date: Tue, 19 Jun 2012 16:43:42 +0000 Subject: [PATCH] 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. --- zenmap/zenmapGUI/ScanInterface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zenmap/zenmapGUI/ScanInterface.py b/zenmap/zenmapGUI/ScanInterface.py index 7220279c7..67b0b8f0a 100644 --- a/zenmap/zenmapGUI/ScanInterface.py +++ b/zenmap/zenmapGUI/ScanInterface.py @@ -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.