mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
Replace == and != with is and is not for comparisons with None
This commit is contained in:
@@ -207,7 +207,7 @@ class HostSearch(object):
|
||||
@staticmethod
|
||||
def match_port(host_ports, port, port_state):
|
||||
# Check if the port is parsable, if not return False silently
|
||||
if re.match("^\d+$", port) == None:
|
||||
if re.match("^\d+$", port) is None:
|
||||
return False
|
||||
|
||||
for hp in host_ports:
|
||||
@@ -329,7 +329,7 @@ class SearchResult(object):
|
||||
fuzz = date_arg.count("~")
|
||||
date_arg = date_arg.replace("~", "")
|
||||
|
||||
if re.match("\d\d\d\d-\d\d-\d\d$", date_arg) != None:
|
||||
if re.match("\d\d\d\d-\d\d-\d\d$", date_arg) is not None:
|
||||
year, month, day = date_arg.split("-")
|
||||
parsed_date = date(int(year), int(month), int(day))
|
||||
elif re.match("[-|\+]\d+$", date_arg):
|
||||
@@ -392,7 +392,7 @@ class SearchResult(object):
|
||||
|
||||
# Check if they're parsable, if not return False silently
|
||||
for port in ports:
|
||||
if re.match("^\d+$", port) == None:
|
||||
if re.match("^\d+$", port) is None:
|
||||
return False
|
||||
|
||||
# Make a list of all scanned ports
|
||||
|
||||
Reference in New Issue
Block a user