summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Basile <me@jakebasile.com>2013-07-18 13:07:25 -0500
committerJake Basile <me@jakebasile.com>2013-07-18 13:07:25 -0500
commitcc81a0e8daf1253d390a5bfae1e7157f3f3f8f3e (patch)
tree510687d91b396b56e1a6a1198055525a29ee1baa
parent262652992da659d6821ab1a250de0dffe6a6beaf (diff)
downloadslixmpp-cc81a0e8daf1253d390a5bfae1e7157f3f3f8f3e.tar.gz
slixmpp-cc81a0e8daf1253d390a5bfae1e7157f3f3f8f3e.tar.bz2
slixmpp-cc81a0e8daf1253d390a5bfae1e7157f3f3f8f3e.tar.xz
slixmpp-cc81a0e8daf1253d390a5bfae1e7157f3f3f8f3e.zip
DRYed up the OSError/socket.gaierror handler.
-rw-r--r--sleekxmpp/xmlstream/resolver.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/sleekxmpp/xmlstream/resolver.py b/sleekxmpp/xmlstream/resolver.py
index 75ba50d1..4cac254c 100644
--- a/sleekxmpp/xmlstream/resolver.py
+++ b/sleekxmpp/xmlstream/resolver.py
@@ -206,11 +206,7 @@ def get_AAAA(host, resolver=None):
recs = socket.getaddrinfo(host, None, socket.AF_INET6,
socket.SOCK_STREAM)
return [rec[4][0] for rec in recs]
- except socket.gaierror:
- log.debug("DNS: Error retreiving AAAA address " + \
- "info for %s." % host)
- return []
- except OSError:
+ except (OSError, socket.gaierror):
log.debug("DNS: Error retreiving AAAA address " + \
"info for %s." % host)
return []