fix problems parsing generic rdata after tokenizer changes
authorBob Halley <halley@nominum.com>
Tue, 12 Jan 2010 23:24:46 +0000 (15:24 -0800)
committerBob Halley <halley@nominum.com>
Tue, 12 Jan 2010 23:24:46 +0000 (15:24 -0800)
dns/rdata.py

index 3d1fd99634f2bbf67cbf1a633e628b19d10bec9f..7e8d606e6ff2e7755f0e847650f51180edccfd28 100644 (file)
@@ -319,7 +319,8 @@ class GenericRdata(Rdata):
         return r'\# %d ' % len(self.data) + _hexify(self.data)
 
     def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
-        if tok.get_string() != r'\#':
+        token = tok.get()
+        if not token.is_identifier() or token.value != '\#'
             raise dns.exception.SyntaxError, \
                   r'generic rdata does not start with \#'
         length = tok.get_int()
@@ -415,7 +416,7 @@ def from_text(rdclass, rdtype, tok, origin = None, relativize = True):
         # peek at first token
         token = tok.get()
         tok.unget(token)
-        if token.is_identifier and \
+        if token.is_identifier() and \
            token.value == r'\#':
             #
             # Known type using the generic syntax.  Extract the