mirror of
https://github.com/nmap/nmap.git
synced 2026-01-17 11:59:04 +00:00
Avoid handling BaseException, so SysExit and KeyboardInterrupt are propagated. #1834
This commit is contained in:
@@ -179,7 +179,7 @@ class UnicodeFileChooserDialog(gtk.FileChooserDialog):
|
||||
encoding = sys.getfilesystemencoding() or "UTF-8"
|
||||
try:
|
||||
filename = filename.decode(encoding)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return filename
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ class ScanWindow(UmitScanWindow):
|
||||
# gtk.STOCK_ABOUT is only available in PyGTK 2.6 and later.
|
||||
try:
|
||||
about_icon = gtk.STOCK_ABOUT
|
||||
except:
|
||||
except AttributeError:
|
||||
about_icon = None
|
||||
|
||||
self.main_actions = [
|
||||
|
||||
@@ -321,7 +321,7 @@ class NmapOutputViewer (gtk.VBox):
|
||||
buf = self.text_view.get_buffer()
|
||||
try:
|
||||
running = (command is not None and command.scan_state() is True)
|
||||
except:
|
||||
except Exception:
|
||||
running = False
|
||||
complete = False
|
||||
else:
|
||||
|
||||
@@ -235,7 +235,7 @@ class ScanHostsView(HIGVBox, object):
|
||||
try:
|
||||
child = self.scrolled.get_child()
|
||||
self.scrolled.remove(child)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def _set_scrolled(self):
|
||||
|
||||
@@ -618,8 +618,8 @@ class ScanInterface(HIGVBox):
|
||||
alive = scan.scan_state()
|
||||
if alive:
|
||||
continue
|
||||
except:
|
||||
log.debug("Scan terminated unexpectedly: %s" % scan.command)
|
||||
except Exception as e:
|
||||
log.debug("Scan terminated unexpectedly: %s (%s)" % (scan.command, e))
|
||||
self.scans_store.fail_running_scan(scan)
|
||||
else:
|
||||
log.debug("Scan finished: %s" % scan.command)
|
||||
@@ -650,7 +650,7 @@ class ScanInterface(HIGVBox):
|
||||
# Some options like --iflist cause Nmap to emit an empty XML
|
||||
# file. Ignore the exception in this case.
|
||||
st = os.stat(command.get_xml_output_filename())
|
||||
except:
|
||||
except Exception:
|
||||
st = None
|
||||
if st is None or st.st_size > 0:
|
||||
warn_dialog = HIGAlertDialog(
|
||||
|
||||
@@ -313,7 +313,7 @@ class ScriptInterface:
|
||||
def script_list_timer_callback(self, process, callback):
|
||||
try:
|
||||
status = process.scan_state()
|
||||
except:
|
||||
except Exception:
|
||||
status = None
|
||||
log.debug("Script interface: script_list_timer_callback %s" %
|
||||
repr(status))
|
||||
|
||||
@@ -180,7 +180,7 @@ class HIGAlertDialog(gtk.MessageDialog):
|
||||
# GTK up to version 2.4 does not have secondary_text
|
||||
try:
|
||||
self.format_secondary_text(secondary_text)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user