diff options
author | Jake Basile <me@jakebasile.com> | 2013-07-18 13:07:25 -0500 |
---|---|---|
committer | Jake Basile <me@jakebasile.com> | 2013-07-18 13:07:25 -0500 |
commit | cc81a0e8daf1253d390a5bfae1e7157f3f3f8f3e (patch) | |
tree | 510687d91b396b56e1a6a1198055525a29ee1baa | |
parent | 262652992da659d6821ab1a250de0dffe6a6beaf (diff) | |
download | slixmpp-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.py | 6 |
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 [] |