Merged in kidmose/pywhois/feature/test-missing-keys (pull request #33)
authorRichard <richardbp@gmail.com>
Thu, 15 Feb 2018 15:32:45 +0000
changeset 167 7bec7a730d69
parent 165 92d15e20f7bd (diff)
parent 166 6cbe4891d62a (current diff)
child 168 d994f11c7e9e
child 179 2fb992c480e4
Merged in kidmose/pywhois/feature/test-missing-keys (pull request #33) test_parser.py: Fail on missing keys
--- a/whois/parser.py	Thu Feb 15 15:00:18 2018 +0100
+++ b/whois/parser.py	Thu Feb 15 15:32:45 2018 +0000
@@ -274,10 +274,22 @@
             return WhoisIe(domain, text)
         elif domain.endswith('.nz'):
             return WhoisNz(domain, text)
+        elif domain.endswith('.space'):
+            return WhoisSpace(domain, text)
         else:
             return WhoisEntry(domain, text)
 
 
+class WhoisSpace(WhoisEntry):
+    """Whois parser for .space domains
+    """
+    def __init__(self, domain, text):
+        if 'No match for "' in text:
+            raise PywhoisError(text)
+        else:
+            WhoisEntry.__init__(self, domain, text)
+
+
 class WhoisCom(WhoisEntry):
     """Whois parser for .com domains
     """