Handle exceptions from python without ipv6 support

This commit is contained in:
Dmitri Bogomolov 2017-02-23 20:22:44 +02:00
parent 9ccd3a0989
commit d974065f8e
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -100,7 +100,10 @@ def checkIPAddress(host, private=False):
return False return False
return hostStandardFormat return hostStandardFormat
else: else:
try:
hostStandardFormat = socket.inet_ntop(socket.AF_INET6, host) hostStandardFormat = socket.inet_ntop(socket.AF_INET6, host)
except ValueError:
return False
if hostStandardFormat == "": if hostStandardFormat == "":
# This can happen on Windows systems which are not 64-bit compatible # This can happen on Windows systems which are not 64-bit compatible
# so let us drop the IPv6 address. # so let us drop the IPv6 address.