Skip to content

Commit 53b7b98

Browse files
committed
Fix assertion when ungetting EOF
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401053
1 parent 15eebd3 commit 53b7b98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/html5lib/inputstream.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ def unget(self, chars):
308308
self.queue.extendleft(l)
309309
#Alter the current line, col position
310310
for c in chars[::-1]:
311-
if c == '\n':
311+
if c is None:
312+
continue
313+
elif c == '\n':
312314
assert self.lineLengths[-1] == 0
313315
self.lineLengths.pop()
314316
else:

0 commit comments

Comments
 (0)