Handle exceptions from python without ipv6 support
This commit is contained in:
parent
9ccd3a0989
commit
d974065f8e
|
@ -100,7 +100,10 @@ def checkIPAddress(host, private=False):
|
||||||
return False
|
return False
|
||||||
return hostStandardFormat
|
return hostStandardFormat
|
||||||
else:
|
else:
|
||||||
hostStandardFormat = socket.inet_ntop(socket.AF_INET6, host)
|
try:
|
||||||
|
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.
|
||||||
|
|
Reference in New Issue
Block a user