# HG changeset patch # User Evgeni Kunev # Date 1415619757 -7200 # Node ID 52ce01013731e79b43efa2d91390919bcf272beb # Parent 5cd71f1dc42beb7d4cc43ec3f015931e420d4192 Handle experimental lookup method for bad domains Attempting to use NICClient with bad domains could hit a bad logical path that leads to an attempt to reference a variable that hasn't been defined. So in case we don't manage to find a nichost for a domain, just set `result` to `None` diff -r 5cd71f1dc42b -r 52ce01013731 whois/whois.py --- a/whois/whois.py Fri Oct 03 16:40:07 2014 +0200 +++ b/whois/whois.py Mon Nov 10 13:42:37 2014 +0200 @@ -206,6 +206,8 @@ nichost = self.choose_server(query_arg) if (nichost is not None): result = self.whois(query_arg, nichost, flags) + else: + result = '' else: result = self.whois(query_arg, options['whoishost'], flags) # print 'whois_lookup finished'