whois.py fix python3 error: if b'with "=xxx"' in response: leotop/whoispy-fix-python3-error-if-bwith-xxx-i-1463323526280
authorIgor Kirsanov <leotop@yandex.ru>
Sun, 15 May 2016 14:45:28 +0000
branchleotop/whoispy-fix-python3-error-if-bwith-xxx-i-1463323526280
changeset 90 f1bcf8940a97
parent 82 fc40924ac59b
child 91 4382433c1fe0
whois.py fix python3 error: if b'with "=xxx"' in response: TypeError: 'in <string>' requires string as left operand, not bytes
whois/whois.py
--- a/whois/whois.py	Thu Mar 17 15:37:34 2016 +0100
+++ b/whois/whois.py	Sun May 15 14:45:28 2016 +0000
@@ -121,7 +121,7 @@
         else:
             nhost = None
             response = response.decode('utf-8', errors='replace')
-            if b'with "=xxx"' in response:
+            if 'with "=xxx"' in response:
                 return self.whois(query, hostname, flags, True)
             if flags & NICClient.WHOIS_RECURSE and nhost is None:
                 nhost = self.findwhois_server(response, hostname, query)