SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Chained Comparison Simplification
Gormogon6b8567a7de40
diff --git a/ext/dns/inet.py b/ext/dns/inet.pyindex 3b7e88f7..be1b970e 100644--- a/ext/dns/inet.py+++ b/ext/dns/inet.py@@ -98,7 +98,7 @@ def is_multicast(text):"""try:first = ord(dns.ipv4.inet_aton(text)[0])- return (first >= 224 and first <= 239)+ return (224 <= first <= 239)except:try:first = ord(dns.ipv6.inet_aton(text)[0])diff --git a/ext/dns/name.py b/ext/dns/name.pyindex 293ab951..19529fef 100644--- a/ext/dns/name.py+++ b/ext/dns/name.py@@ -95,7 +95,7 @@ def _escapify(label):for c in label:if c in _escaped:text += '\\' + c- elif ord(c) > 0x20 and ord(c) < 0x7F:+ elif 0x20 < ord(c) < 0x7F:text += celse:text += '\\%03d' % ord(c)diff --git a/ext/dns/opcode.py b/ext/dns/opcode.pyindex 3258c34c..5c88e706 100644--- a/ext/dns/opcode.py+++ b/ext/dns/opcode.py@@ -53,7 +53,7 @@ def from_text(text):if text.isdigit():value = int(text)- if value >= 0 and value <= 15:+ if 0 <= value <= 15:return valuevalue = _by_text.get(text.upper())if value is None:diff --git a/ext/dns/rcode.py b/ext/dns/rcode.pyindex 7807782a..a1790f4d 100644--- a/ext/dns/rcode.py+++ b/ext/dns/rcode.py@@ -67,7 +67,7 @@ def from_text(text):if text.isdigit():v = int(text)- if v >= 0 and v <= 4095:+ if 0 <= v <= 4095:return vv = _by_text.get(text.upper())if v is None:diff --git a/ext/dns/rdata.py b/ext/dns/rdata.pyindex 350bf790..162ba151 100644--- a/ext/dns/rdata.py+++ b/ext/dns/rdata.py@@ -104,7 +104,7 @@ def _escapify(qstring):for c in qstring:if c in __escaped:text += '\\' + c- elif ord(c) >= 0x20 and ord(c) < 0x7F:+ elif 0x20 <= ord(c) < 0x7F:text += celse:text += '\\%03d' % ord(c)diff --git a/ext/dns/rdatatype.py b/ext/dns/rdatatype.pyindex fe7cbff3..ff81a054 100644--- a/ext/dns/rdatatype.py+++ b/ext/dns/rdatatype.py@@ -219,7 +219,7 @@ def is_metatype(rdtype):@type rdtype: int@rtype: bool"""- if rdtype >= TKEY and rdtype <= ANY or _metatypes.has_key(rdtype):+ if TKEY <= rdtype <= ANY or _metatypes.has_key(rdtype):return Truereturn Falsediff --git a/ext/exifread/utils.py b/ext/exifread/utils.pyindex f5e0d7fe..ed4c8daf 100644--- a/ext/exifread/utils.py+++ b/ext/exifread/utils.py@@ -17,7 +17,7 @@ def make_string(seq):for c in seq:# Screen out non-printing characterstry:- if 32 <= c and c < 256:+ if 32 <= c < 256:string += chr(c)except TypeError:passdiff --git a/ext/pyPdf/filters.py b/ext/pyPdf/filters.pyindex 7fe10fb4..ebdacd0e 100644--- a/ext/pyPdf/filters.py+++ b/ext/pyPdf/filters.py@@ -106,7 +106,7 @@ class FlateDecode(object):if predictor != 1:columns = decodeParms["/Columns"]# PNG prediction:- if predictor >= 10 and predictor <= 15:+ if 10 <= predictor <= 15:output = StringIO()# PNG prediction can vary from row to rowrowlength = columns + 1@@ -191,7 +191,7 @@ class ASCII85Decode(object):breakelse:c = ord(c) - 33- assert c >= 0 and c < 85+ assert 0 <= c < 85group += [ c ]if len(group) >= 5:b = group[0] * (85**4) + \