[Python-checkins] cpython (3.4): asyncio: Fix _check_resolved_address() for IPv6 address

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


http://hg.python.org/cpython/rev/4b326b3c307c
changeset:   89749:4b326b3c307c
branch:      3.4
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Feb 20 16:43:09 2014 +0100
summary:
  asyncio: Fix _check_resolved_address() for IPv6 address

files:
  Lib/asyncio/base_events.py |  7 +++++--
  1 files changed, 5 insertions(+), 2 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
@@ -45,10 +45,13 @@
     # Ensure that the address is already resolved to avoid the trap of hanging
     # the entire event loop when the address requires doing a DNS lookup.
     family = sock.family
-    if family not in (socket.AF_INET, socket.AF_INET6):
+    if family == socket.AF_INET:
+        host, port = address
+    elif family == socket.AF_INET6:
+        host, port, flow_info, scope_id = address
+    else:
         return
 
-    host, port = address
     type_mask = 0
     if hasattr(socket, 'SOCK_NONBLOCK'):
         type_mask |= socket.SOCK_NONBLOCK

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


More information about the Python-checkins mailing list