Handle experimental lookup method for bad domains
authorEvgeni Kunev <evgeni.kunev@gmail.com>
Mon, 10 Nov 2014 13:42:37 +0200
changeset 45 52ce01013731
parent 44 5cd71f1dc42b
child 46 b3862a45fdad
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`
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'