mirror of
https://github.com/nmap/nmap.git
synced 2025-12-11 18:29:03 +00:00
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).
23 KiB
23 KiB