From 897a9ac3335ef42e454aba44346d8702564ab48f Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 20 Jan 2011 04:23:00 +0800 Subject: [PATCH] Do not traceback when DNS resolution time out. Just log that the resolution timed out, and fall back to the hostname from the JID in this case --- sleekxmpp/clientxmpp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py index 734c9a14..b8668107 100644 --- a/sleekxmpp/clientxmpp.py +++ b/sleekxmpp/clientxmpp.py @@ -169,6 +169,8 @@ class ClientXMPP(BaseXMPP): except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer): log.debug("No appropriate SRV record found." + \ " Using JID server name.") + except (dns.exception.Timeout,): + log.debug("DNS resolution timed out.") else: # Pick a random server, weighted by priority.