summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/resolver.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/xmlstream/resolver.py')
-rw-r--r--sleekxmpp/xmlstream/resolver.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/resolver.py b/sleekxmpp/xmlstream/resolver.py
index 16f8a7ad..6f26797f 100644
--- a/sleekxmpp/xmlstream/resolver.py
+++ b/sleekxmpp/xmlstream/resolver.py
@@ -202,11 +202,14 @@ def get_AAAA(host, resolver=None):
# If not using dnspython, attempt lookup using the OS level
# getaddrinfo() method.
if resolver is None:
+ if not socket.has_ipv6:
+ log.debug("Unable to query %s for AAAA records: IPv6 is not supported", host)
+ return []
try:
recs = socket.getaddrinfo(host, None, socket.AF_INET6,
socket.SOCK_STREAM)
return [rec[4][0] for rec in recs]
- except socket.gaierror:
+ except (OSError, socket.gaierror):
log.debug("DNS: Error retreiving AAAA address " + \
"info for %s." % host)
return []