Skip to content

Commit dc827e8

Browse files
committed
Prefix the bufferedCharacter, don't suffix it. Also, file objects return the empty string at EOF.
1 parent 15d9b0e commit dc827e8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

html5lib/inputstream.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,7 @@ def readChunk(self, chunkSize=None):
347347

348348
#Deal with CR LF and surrogates broken across chunks
349349
if self._bufferedCharacter:
350-
if data:
351-
data = data + self._bufferedCharacter
352-
else:
353-
data = self._bufferedCharacter
350+
data = self._bufferedCharacter + data
354351
self._bufferedCharacter = None
355352
elif not data:
356353
# We have no more data, bye-bye stream

0 commit comments

Comments
 (0)