diff options
author | Florent Le Coz <louiz@louiz.org> | 2010-11-08 09:14:17 +0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-11-09 01:53:41 +0800 |
commit | 9dbf246f0bfcac2c4ce538431ee629f126c86447 (patch) | |
tree | 9fe3bd976f28f619437a443e2321a1816d2e1072 /sleekxmpp/clientxmpp.py | |
parent | 4fb77ac8787422169566d613562127acf75a427b (diff) | |
download | slixmpp-9dbf246f0bfcac2c4ce538431ee629f126c86447.tar.gz slixmpp-9dbf246f0bfcac2c4ce538431ee629f126c86447.tar.bz2 slixmpp-9dbf246f0bfcac2c4ce538431ee629f126c86447.tar.xz slixmpp-9dbf246f0bfcac2c4ce538431ee629f126c86447.zip |
Doesn't fail if host has NO SRV record
Just catch an other exception type coming from the dns resolver that
could be raised with hosts like "anon.example.com" which just don't have
any SRV record.
Diffstat (limited to 'sleekxmpp/clientxmpp.py')
-rw-r--r-- | sleekxmpp/clientxmpp.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py index a88c5ccb..1c600812 100644 --- a/sleekxmpp/clientxmpp.py +++ b/sleekxmpp/clientxmpp.py @@ -164,7 +164,7 @@ class ClientXMPP(BaseXMPP): try: xmpp_srv = "_xmpp-client._tcp.%s" % self.server answers = dns.resolver.query(xmpp_srv, dns.rdatatype.SRV) - except dns.resolver.NXDOMAIN: + except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer): log.debug("No appropriate SRV record found." + \ " Using JID server name.") else: |