summaryrefslogtreecommitdiff
path: root/dns/zone.py
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2005-09-02 05:22:23 +0000
committerBob Halley <halley@dnspython.org>2005-09-02 05:22:23 +0000
commit54fd6bc9dec868e903535d8164f255ae8d1b8712 (patch)
treef75a6468de890abee2e8a769231e737340a3cc10 /dns/zone.py
parente163f6673e47268575741f377592847df97196df (diff)
downloaddnspython-54fd6bc9dec868e903535d8164f255ae8d1b8712.tar.gz
treat leading whitespace followed by EOL/EOF as a blank line
Original author: Bob Halley <halley@dnspython.org> Date: 2004-04-09 10:09:59
Diffstat (limited to 'dns/zone.py')
-rw-r--r--dns/zone.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/dns/zone.py b/dns/zone.py
index 711e26d..002366b 100644
--- a/dns/zone.py
+++ b/dns/zone.py
@@ -567,6 +567,13 @@ class _MasterReader(object):
token = self.tok.get(want_leading = True)
if token[0] != dns.tokenizer.WHITESPACE:
self.last_name = dns.name.from_text(token[1], self.current_origin)
+ else:
+ token = self.tok.get()
+ if token[0] == dns.tokenizer.EOL or \
+ token[0] == dns.tokenizer.EOF:
+ # treat leading WS followed by EOL/EOF as if they were EOL/EOF.
+ return
+ self.tok.unget(token)
name = self.last_name
if not name.is_subdomain(self.zone.origin):
self._eat_line()