catch ValueError when ipv6 isn't not supported on the platform

fix #479
This commit is contained in:
benoitc 2013-04-21 07:47:19 +02:00
parent c31e0f9ac7
commit 9acafc25f0

View File

@ -209,6 +209,8 @@ def is_ipv6(addr):
socket.inet_pton(socket.AF_INET6, addr)
except socket.error: # not a valid address
return False
except ValueError: # ipv6 not supported on this platform
return False
return True