]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Add some comments about opportunities after 3.6 is not supported.
authorBob Halley <halley@dnspython.org>
Sat, 13 Jun 2020 17:57:46 +0000 (10:57 -0700)
committerBob Halley <halley@dnspython.org>
Sat, 13 Jun 2020 17:57:46 +0000 (10:57 -0700)
dns/_asyncbackend.py
dns/asyncquery.py
tests/test_async.py

index dc1330e1593700cc00e5670d6ccbf425c522ce8c..093713d1baf39b340ff4ae7267d445ad92f11b7e 100644 (file)
@@ -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):
index 68d1a355a4b7bd5c3b871b5b0145ca71973081ec..03e9fadafdc9ce4cbe89c121b482a19b550c4062 100644 (file)
@@ -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:
index ed75b9c10753dfae5a07bc8327f3cda31a2f863c..5c26309289e8d16948254c1f92ec584258f18d14 100644 (file)
@@ -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)