summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-20 15:43:09 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-02-20 15:43:09 (GMT)
commit013dece44daf2483c2ba2771d7d01de28f33ab50 (patch)
tree788029f3cd85a38184b6cdf6a06823f8a9febbe5 /Lib/asyncio
parentda492a8c39f8d7509de5f3f14d0b957a32fc66ea (diff)
downloadcpython-013dece44daf2483c2ba2771d7d01de28f33ab50.zip
cpython-013dece44daf2483c2ba2771d7d01de28f33ab50.tar.gz
cpython-013dece44daf2483c2ba2771d7d01de28f33ab50.tar.bz2
asyncio: Fix _check_resolved_address() for IPv6 address
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_events.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 69caa4d..1615ecb 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -45,10 +45,13 @@ def _check_resolved_address(sock, address):
# 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