1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-11 18:29:03 +00:00
Files
nmap/zenmap/zenmapGUI/ScanHostDetailsPage.py
dmiller 8b70dfa0a4 Replace exception-as-flow-control pattern
In general, it's better to use explicit flow control than to throw
and/or catch generic exceptions. Example:

try:
    thing = d["key"]
except:
    pass

This 1. catches an inspecific exception (probably KeyError), 2. can be
replaced with a check for ("key" is in d), and 3. can often be replaced
with d.get("key", some_default_value).
2014-01-13 15:37:39 +00:00

23 KiB