diff --git a/html5lib/_inputstream.py b/html5lib/_inputstream.py index 177f0ab9..aabc7b88 100644 --- a/html5lib/_inputstream.py +++ b/html5lib/_inputstream.py @@ -367,7 +367,7 @@ def charsUntil(self, characters, opposite=False): def unget(self, char): # Only one character is allowed to be ungotten at once - it must # be consumed again before any further call to unget - if char is not None: + if char is not EOF: if self.chunkOffset == 0: # unget is called quite rarely, so it's a good idea to do # more work here if it saves a bit of work in the frequently