From: Bob Halley Date: Tue, 12 Jan 2010 23:24:46 +0000 (-0800) Subject: fix problems parsing generic rdata after tokenizer changes X-Git-Tag: v1.8.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cf68ff2679bf078d6cf12b12c64c0ded3f832a1;p=thirdparty%2Fdnspython.git fix problems parsing generic rdata after tokenizer changes --- diff --git a/dns/rdata.py b/dns/rdata.py index 3d1fd996..7e8d606e 100644 --- a/dns/rdata.py +++ b/dns/rdata.py @@ -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