[Python-checkins] cpython (3.4): asyncio: _check_resolved_address() must also accept IPv6 without flow_info and

larry.hastings python-checkins at python.org
Mon Mar 17 07:32:38 CET 2014


http://hg.python.org/cpython/rev/19d361106e92
changeset:   89753:19d361106e92
branch:      3.4
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Feb 20 21:59:38 2014 +0100
summary:
  asyncio: _check_resolved_address() must also accept IPv6 without flow_info and
scope_id: (host, port).

files:
  Lib/asyncio/base_events.py           |  2 +-
  Lib/test/test_asyncio/test_events.py |  9 ++++++---
  2 files changed, 7 insertions(+), 4 deletions(-)


diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -48,7 +48,7 @@
     if family == socket.AF_INET:
         host, port = address
     elif family == socket.AF_INET6:
-        host, port, flow_info, scope_id = address
+        host, port = address[:2]
     else:
         return
 
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -1335,11 +1335,14 @@
              'selector': self.loop._selector.__class__.__name__})
 
     def test_sock_connect_address(self):
-        families = [(socket.AF_INET, ('www.python.org', 80))]
+        addresses = [(socket.AF_INET, ('www.python.org', 80))]
         if support.IPV6_ENABLED:
-            families.append((socket.AF_INET6, ('www.python.org', 80, 0, 0)))
+            addresses.extend((
+                (socket.AF_INET6, ('www.python.org', 80)),
+                (socket.AF_INET6, ('www.python.org', 80, 0, 0)),
+            ))
 
-        for family, address in families:
+        for family, address in addresses:
             for sock_type in (socket.SOCK_STREAM, socket.SOCK_DGRAM):
                 sock = socket.socket(family, sock_type)
                 with sock:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list