From: Bob Halley Date: Thu, 17 Feb 2022 16:00:13 +0000 (-0800) Subject: lgtm lint: suppress false positive X-Git-Tag: v2.3.0rc1~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87975ea271edfae4b46ed05ea5a31ada1d5087d3;p=thirdparty%2Fdnspython.git lgtm lint: suppress false positive --- diff --git a/dns/query.py b/dns/query.py index c399941b..875fcc0f 100644 --- a/dns/query.py +++ b/dns/query.py @@ -239,7 +239,8 @@ def _make_socket(af, type, source, ssl_context=None, server_hostname=None): if source is not None: s.bind(source) if ssl_context: - return ssl_context.wrap_socket(s, do_handshake_on_connect=False, + # LGTM gets a false positive here, as our default context is OK + return ssl_context.wrap_socket(s, do_handshake_on_connect=False, # lgtm[py/insecure-protocol] server_hostname=server_hostname) else: return s diff --git a/tests/test_query.py b/tests/test_query.py index 2cff3770..48c8b841 100644 --- a/tests/test_query.py +++ b/tests/test_query.py @@ -151,7 +151,7 @@ class QueryTests(unittest.TestCase): base_s.settimeout(2) base_s.connect(ll) ctx = ssl.create_default_context() - with ctx.wrap_socket(base_s, server_hostname='dns.google') as s: + with ctx.wrap_socket(base_s, server_hostname='dns.google') as s: # lgtm[py/insecure-protocol] s.setblocking(0) qname = dns.name.from_text('dns.google.') q = dns.message.make_query(qname, dns.rdatatype.A)