From: Bob Halley Date: Sat, 13 Jun 2020 17:57:46 +0000 (-0700) Subject: Add some comments about opportunities after 3.6 is not supported. X-Git-Tag: v2.0.0rc1~112^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dce23a614f2d11bd802c7f9aed8f3ab0e883f468;p=thirdparty%2Fdnspython.git Add some comments about opportunities after 3.6 is not supported. --- diff --git a/dns/_asyncbackend.py b/dns/_asyncbackend.py index dc1330e1..093713d1 100644 --- a/dns/_asyncbackend.py +++ b/dns/_asyncbackend.py @@ -5,7 +5,8 @@ import socket import dns.inet -# This is a nullcontext for both sync and async +# This is a nullcontext for both sync and async. 3.7 has a nullcontext, +# but it is only for sync use. class NullContext: def __init__(self, enter_result=None): diff --git a/dns/asyncquery.py b/dns/asyncquery.py index 68d1a355..03e9fada 100644 --- a/dns/asyncquery.py +++ b/dns/asyncquery.py @@ -189,6 +189,7 @@ async def udp(q, where, timeout=None, port=53, source=None, source_port=0, wire = q.to_wire() (begin_time, expiration) = _compute_times(timeout) s = None + # After 3.6 is no longer supported, this can use an AsyncExitStack. try: if sock: s = sock @@ -391,6 +392,7 @@ async def tcp(q, where, timeout=None, port=53, source=None, source_port=0, wire = q.to_wire() (begin_time, expiration) = _compute_times(timeout) s = None + # After 3.6 is no longer supported, this can use an AsyncExitStack. try: if sock: # Verify that the socket is connected, as if it's not connected, @@ -468,6 +470,7 @@ async def tls(q, where, timeout=None, port=853, source=None, source_port=0, Returns a ``dns.message.Message``. """ + # After 3.6 is no longer supported, this can use an AsyncExitStack. (begin_time, expiration) = _compute_times(timeout) if not sock: if ssl_context is None: diff --git a/tests/test_async.py b/tests/test_async.py index ed75b9c1..5c263092 100644 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -57,6 +57,7 @@ class AsyncTests(unittest.TestCase): try: runner = asyncio.run except AttributeError: + # this is only needed for 3.6 def old_runner(awaitable): loop = asyncio.get_event_loop() return loop.run_until_complete(awaitable)