diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py index f7bf8f8..3536e8e 100644 --- a/sleekxmpp/clientxmpp.py +++ b/sleekxmpp/clientxmpp.py @@ -145,7 +145,7 @@ class ClientXMPP(BaseXMPP): if DNSPYTHON: try: answers = [((answer.target.to_text()[:-1], answer.port), answer.priority, answer.weight) for answer in dns.resolver.query("_xmpp-client._tcp.%s" % domain, dns.rdatatype.SRV)] - except dns.resolver.NXDOMAIN, dns.resolver.NoAnswer: + except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer): log.warning("No SRV records for %s" % domain) answers = super(ClientXMPP, self).get_dns_records(domain, port) except dns.exception.Timeout: diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index b090bea..6c2c5aa 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -662,7 +662,7 @@ class XMLStream(object): if DNSPYTHON: try: answers = dns.resolver.query(domain, dns.rdatatype.A) - except dns.resolver.NXDOMAIN, dns.resolver.NoAnswer: + except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer): log.warning("No A records for %s" % domain) except dns.exception.Timeout: log.warning("DNS resolution timed out for A record of %s" % domain)