whois/whois.py
changeset 36 af839b9c0ed1
parent 34 f9da616f15cf
child 45 52ce01013731
equal deleted inserted replaced
35:0de2468a27e8 36:af839b9c0ed1
   162         # print 'returning whois response'
   162         # print 'returning whois response'
   163         return response.decode()
   163         return response.decode()
   164 
   164 
   165     def choose_server(self, domain):
   165     def choose_server(self, domain):
   166         """Choose initial lookup NIC host"""
   166         """Choose initial lookup NIC host"""
       
   167         if type(domain) is not unicode:
       
   168             domain = domain.decode('utf-8').encode('idna')
   167         if (domain.endswith("-NORID")):
   169         if (domain.endswith("-NORID")):
   168             return NICClient.NORIDHOST
   170             return NICClient.NORIDHOST
   169         pos = domain.rfind('.')
   171         pos = domain.rfind('.')
   170         if (pos == -1):
   172         if (pos == -1):
   171             return None
   173             return None